home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / softc101.arc / SOFTC.MAN < prev    next >
Encoding:
Text File  |  1989-02-15  |  234.0 KB  |  5,777 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                            SoftC Library Reference Manual
  18.  
  19.                                     Version 1.01
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.                       Manual and Software Copyright 1988, 1989
  41.                                          by
  42.                                    K. L. Schumann
  43.                             16820 3rd Street North East
  44.                              Ham Lake, Minnesota 55304
  45.                                    (612) 434-6968
  46.  
  47.                                 ALL RIGHTS RESERVED
  48.  
  49.  
  50.  
  51.  
  52.  
  53.             This document describes version 1.01 of the SoftC Library,
  54.             created in February 1989.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                      DISCLAIMER
  61.  
  62.  
  63.             The  author  makes  no  representation  or  warranties  with
  64.             respect to  this  product  and  specifically  disclaims  any
  65.             implied warranties  or merchantability  or fitness  for  any
  66.             particular purpose.  The author shall have no liability with
  67.             respect  to   his  obligations   under  this  agreement  for
  68.             compensatory,   special,   incidental,   consequential,   or
  69.             exemplary damages.
  70.  
  71.  
  72.             The author further reserves the right to make changes to the
  73.             specifications of  the library  and contents  of the  manual
  74.             without obligation  to notify any person or organizations of
  75.             such changes.
  76.  
  77.  
  78.                                   Table of Contents
  79.  
  80.  
  81.             Chapter 1 Introduction................................ 1
  82.                 Registration...................................... 2
  83.                 User Supported Software........................... 2
  84.                 Typographic Conventions........................... 3
  85.                 Trademarks........................................ 3
  86.                 Support and Updates............................... 3
  87.                 The Future........................................ 3
  88.             Chapter 2 Before You Begin............................ 4
  89.                 The READ.ME File.................................. 4
  90.                 Installing SoftC on Your System................... 4
  91.                 SoftC Applications................................ 5
  92.                 Compiling with Turbo C............................ 6
  93.                 Recompiling the SoftC Libraries................... 6
  94.                 Function Naming Conventions....................... 6
  95.             Chapter 3 A Windows Toolkit Tutorial.................. 7
  96.                 Basic Rules....................................... 7
  97.                 Screen Output..................................... 8
  98.                 Cursor Control.................................... 8
  99.                 Erase Functions................................... 9
  100.                 Character Colors.................................. 9
  101.                 Window Control.................................... 9
  102.                 Window Colors..................................... 10
  103.                 Window Border Styles.............................. 10
  104.                 Window Titles..................................... 10
  105.             Chapter 4 A dBase III Toolkit Tutorial................ 11
  106.                 Sequential Files.................................. 11
  107.                 Random Access Files............................... 11
  108.                 Keys.............................................. 11
  109.                 ISAM and B-trees.................................. 12
  110.                 Basic Rules....................................... 13
  111.                 Data File Functions............................... 13
  112.                 Data Record I/O................................... 13
  113.                 Data Field I/O.................................... 14
  114.                 Index File Functions.............................. 15
  115.                 Index Page Functions.............................. 15
  116.                 Index Key Functions............................... 15
  117.             Chapter 5 Clock & Calendar Functions.................. 17
  118.             Chapter 6 Miscellaneous Functions..................... 18
  119.             Chapter 7 The SoftC Library........................... 19
  120.                 sccday............................................ 21
  121.                 sccddiff.......................................... 22
  122.                 sccdn2s........................................... 23
  123.                 sccds2n........................................... 24
  124.                 sccdvalid......................................... 25
  125.                 sccdxlat.......................................... 25
  126.                 sccleap........................................... 26
  127.                 sccleapi.......................................... 27
  128.                 sccmonth.......................................... 28
  129.                 scdclose.......................................... 29
  130.                 scdcreate......................................... 30
  131.                 scdfget........................................... 32
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.                                          iii
  139.  
  140.  
  141.                                   Table of Contents
  142.  
  143.  
  144.                 scdfgets.......................................... 33
  145.                 scdfinfo.......................................... 34
  146.                 scdfnam2no........................................ 36
  147.                 scdfput........................................... 37
  148.                 scdfputs.......................................... 38
  149.                 scdinfo........................................... 39
  150.                 scdopen........................................... 40
  151.                 scdrclear......................................... 41
  152.                 scdrcopy.......................................... 42
  153.                 scdrdel........................................... 43
  154.                 scdrget........................................... 44
  155.                 scdrinfo.......................................... 46
  156.                 scdrput........................................... 47
  157.                 scdrundel......................................... 48
  158.                 scdsize........................................... 49
  159.                 sceclr............................................ 50
  160.                 scemsg............................................ 51
  161.                 sciclose.......................................... 52
  162.                 scicreate......................................... 53
  163.                 sciexpr........................................... 54
  164.                 sciinfo........................................... 55
  165.                 scikadd........................................... 56
  166.                 scikcur........................................... 58
  167.                 scikdel........................................... 59
  168.                 scikfind.......................................... 60
  169.                 scikfirst......................................... 62
  170.                 sciklast.......................................... 63
  171.                 scikmake.......................................... 64
  172.                 sciknext.......................................... 67
  173.                 scikprev.......................................... 68
  174.                 scinit............................................ 69
  175.                 sciopen........................................... 70
  176.                 scipinfo.......................................... 71
  177.                 scipnum........................................... 72
  178.                 scterm............................................ 73
  179.                 scvers............................................ 74
  180.                 scwaget........................................... 74
  181.                 scwaput........................................... 75
  182.                 scwbget........................................... 76
  183.                 scwbput........................................... 78
  184.                 scwcget........................................... 79
  185.                 scwclose.......................................... 81
  186.                 scwclr............................................ 83
  187.                 scwclreol......................................... 83
  188.                 scwcput........................................... 84
  189.                 scwcursoff........................................ 85
  190.                 scwcurson......................................... 86
  191.                 scwgoto........................................... 87
  192.                 scwinfo........................................... 88
  193.                 scwopen........................................... 89
  194.                 scwopenx.......................................... 90
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.                                          iv
  202.  
  203.  
  204.                                   Table of Contents
  205.  
  206.  
  207.                 scwprintf......................................... 92
  208.                 scwputc........................................... 93
  209.                 scwputs........................................... 94
  210.                 scwselect......................................... 95
  211.                 scwtget........................................... 96
  212.                 scwtput........................................... 97
  213.                 scwxloc........................................... 98
  214.                 scwyloc........................................... 99
  215.             Index................................................. 100
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.                                           v
  265.  
  266.  
  267.           
  268.  
  269.  
  270.           Chapter 1
  271.           Chapter 1
  272.  
  273.  
  274.           Introduction
  275.           Introduction
  276.  
  277.  
  278.  
  279.  
  280.           C is generally considered to be a "bare-bones" language. A way to
  281.           put some flesh on those bones is to develop generalized functions
  282.           (extensions) which  may be  reused in many programs. The presence
  283.           of these  functions can make programming a quick and simple task.
  284.           The absence of these language extensions can mean many hours lost
  285.           "re-inventing the wheel".
  286.  
  287.  
  288.           Few programmers  have the time required to develop and debug such
  289.           a library  of functions.  This is  where  SoftC  comes  in.  This
  290.           library is  a collection  of  functions  designed  to  make  your
  291.           applications quicker  and easier to code and test. With the SoftC
  292.           library you  can spend time on your application not on developing
  293.           tools.
  294.  
  295.  
  296.           There also  is a  benefit to  using functions  found in a toolkit
  297.           library versus  using the  functions  found  in  your  compiler's
  298.           library. It  may seem  trivial, but  if you ever decide to change
  299.           compilers you  will find  that it will take many hours to convert
  300.           your source  to match  the new compiler's syntax. Using a generic
  301.           toolkit such as SoftC will eliminate that effort.
  302.  
  303.  
  304.           SoftC adds powerful capabilities to your function library:
  305.  
  306.  
  307.                -cursor positioning
  308.                -windowing
  309.                -screen output
  310.                -character attribute control
  311.                -date manipulation and calculation
  312.                -database data and index file functions
  313.  
  314.  
  315.           The SoftC  library is  intended for  use as  a supplement to your
  316.           compiler's object  libraries. It contains over seventy functions.
  317.           Currently is  has three  main features:  text windowing, dBaseIII
  318.           compatible data  and index  file manipulation, and clock/calendar
  319.           functions. The library is currently available only for Turbo C (I
  320.           am working on a Microsoft C version). These routines were written
  321.           in C.
  322.  
  323.  
  324.           The SoftC  library is the copyrighted property of K. L. Schumann.
  325.           You are granted a limited license to use the library, and to copy
  326.  
  327.  
  328.           2    Chapter 1, Introduction
  329.           2                           
  330.  
  331.  
  332.           and  distribute   the  following  files  (without  modification):
  333.           SOFTC.H, DBASE.H,  WINDOWS.H, SCTC20S.LIB, SOFTC.MAN, READ.ME and
  334.           REGISTER.
  335.  
  336.  
  337.           Registration
  338.           Registration
  339.  
  340.           If you  find this  library useful, you are encouraged to register
  341.           your copy  for only  $20. Once  registered you  will receive  two
  342.           diskettes containing  the complete  C source  for the library and
  343.           the remaining memory model libraries.
  344.  
  345.  
  346.           To register  print the  file "REGISTER",  read it,  and mail  the
  347.           completed form to:
  348.  
  349.  
  350.                                    Kim L. Schumann
  351.                              16820 3rd Street North East
  352.                               Ham Lake, Minnesota 55304
  353.  
  354.  
  355.           User Supported Software
  356.           User Supported Software
  357.  
  358.           This library  is user supported software. This means that you may
  359.           copy and  distribute it (under the conditions specified above) to
  360.           anyone at no cost. They are in turn requested to register if they
  361.           decide to use it.
  362.  
  363.  
  364.           The  user  supported  software  concept  (often  referred  to  as
  365.           shareware) is  an attempt to provide useful software at low cost.
  366.           The expense  of offering  a new  product by conventional means is
  367.           quite high  and thus  discourages many  independent  authors  and
  368.           small companies  from developing  and promoting their ideas. User
  369.           supported software  is an  attempt to  develop  a  new  marketing
  370.           channel where products can be introduced at minimum cost.
  371.  
  372.  
  373.           Everyone will  benefit if user supported software works. The user
  374.           benefits by  receiving quality products at low cost, and by being
  375.           able to test software thoroughly before purchasing it. The author
  376.           benefits by  being able  to enter  the commercial software market
  377.           without the need of large amounts of venture capital.
  378.  
  379.  
  380.           But it  can only  work with  your support.  If you  obtain a user
  381.           supported product  from a friend or coworker, and are still using
  382.           it after  a couple of weeks, then it is obviously worth something
  383.           to you, and a contribution should be sent.
  384.  
  385.  
  386.                                                Chapter 1, Introduction    3
  387.                                                                           3
  388.  
  389.  
  390.           Typographic Conventions
  391.           Typographic Conventions
  392.  
  393.           []             Square brackets enclose optional data.
  394.           Boldface       SoftC Library function names (such as
  395.           Boldface                                            
  396.                          scinit) and structure names when they
  397.                          scinit                               
  398.                           appear in text (but not in program
  399.                          examples).
  400.           Italics        indicate variable names (identifiers) that
  401.           _______                                 ___________      
  402.                          appear in text.
  403.  
  404.  
  405.           Trademarks
  406.           Trademarks
  407.  
  408.           Clipper is a registered trademark of Nantucket Software.
  409.           dBASEIII is a registered trademark of Ashton-Tate.
  410.           Microsoft is a registered trademark of Microsoft Corporation.
  411.           Turbo C is a registered trademark of Borland International.
  412.  
  413.  
  414.           Support and Updates
  415.           Support and Updates
  416.  
  417.           I will  only offer  advice and  technical support  to  those  who
  418.           contribute via  the shareware concept. Users who register will be
  419.           notified when updates and new products are available.
  420.  
  421.  
  422.           I can  be contacted  by telephone  at (612)  434-6968  after  6pm
  423.           Central Time,  via mail  at the registration address above, or on
  424.           GEnie through GE Mail at "K.SCHUMANN".
  425.  
  426.  
  427.           The Future
  428.           The Future
  429.  
  430.           There are  many enhancements  that could  be made to the dBaseIII
  431.           routines: make  them LAN multi-user, add functions found in dBase
  432.           which do not have a corresponding C function, and add support for
  433.           dBaseIII MEMO fields.
  434.  
  435.  
  436.           The window  toolkit was  written with  expansion  into  graphical
  437.           windows in  mind.  Adding  a  virtual  window  feature  could  be
  438.           incorporated if there is enough demand.
  439.  
  440.  
  441.           I would  like to  add pop-up,  and pull down menuing functions to
  442.           the library.  Formatted input  functions are  also on the "to do"
  443.           list.
  444.  
  445.  
  446.           Anyone wishing  to offer  advice and suggestions are most welcome
  447.           to do so.
  448.  
  449.  
  450.           
  451.  
  452.  
  453.           Chapter 2
  454.           Chapter 2
  455.  
  456.  
  457.           Before You Begin
  458.           Before You Begin
  459.  
  460.  
  461.  
  462.  
  463.           This chapter  supplies instructions for installing the library on
  464.           your hard disk and compiling the source.
  465.  
  466.  
  467.           The READ.ME File
  468.           The READ.ME File
  469.  
  470.           For  last   minute  update  information  not  contained  in  this
  471.           documentation, and/or a brief description of what's new with this
  472.           release please  read  the  READ.ME  file  found  on  the  library
  473.           diskette (or if you have the demonstration version of the library
  474.           it will be found in the .ARC file).
  475.  
  476.  
  477.           Installing SoftC on Your System
  478.           Installing SoftC on Your System
  479.  
  480.           The Source  Code disk  is compatible  with all  of the  compilers
  481.           which I  support. The  Library disk,  however, will  differ  from
  482.           compiler to  compiler. Check the label to be certain you have the
  483.           proper library disk for your compiler.
  484.  
  485.  
  486.           Because the  library disk  is supplied for your compiler, you can
  487.           get started  right away. The source can be recompiled if you ever
  488.           change compilers. It is a good idea to recompile the library when
  489.           you upgrade your compiler.
  490.  
  491.  
  492.           Many compiler  manufacturers suggest a certain directory setup to
  493.           enable the  compiler to  find the  header,  object,  and  library
  494.           files. Rather  than trying  to explain  the various manufacturers
  495.           suggested  directory  setups,  I  will  explain  what  files  are
  496.           required and where they are often located.
  497.  
  498.  
  499.           The SoftC  header files need to be placed where they can be found
  500.           by your  compiler. In  many cases  this is in a special "INCLUDE"
  501.           directory. Other  times they are placed where your source code is
  502.           found. I would suggest that they be placed where the header files
  503.           for your compiler are located. All the header files will be found
  504.           on the source code diskette.
  505.  
  506.  
  507.           Your linker  will need  to be  able  to  find  the  SoftC  object
  508.           libraries. It  is suggested  that these  be placed where the run-
  509.           time libraries for your compiler are found.
  510.  
  511.  
  512.                                            Chapter 2, Before You Begin    5
  513.                                                                           5
  514.  
  515.  
  516.           Different libraries  are supplied  for the  various memory models
  517.           your compiler  supports. The  name of  the  library  defines  the
  518.           compiler manufacturer and version, and the memory model for which
  519.           it was  compiled. All library names begin with "SC". The next few
  520.           characters specify  the compiler manufacturer. The last character
  521.           defines the memory model.
  522.  
  523.  
  524.           For example  SCTC20S.LIB is  the small  memory model  library for
  525.           Borland's Turbo C compiler (version 2.x).
  526.  
  527.  
  528.           You may  copy only the libraries for the memory model(s) you plan
  529.           to use. But then again, if you have the space available you could
  530.           copy them all just to have them available.
  531.  
  532.  
  533.           SoftC Applications
  534.           SoftC Applications
  535.  
  536.           A typical application skeleton has the following form:
  537.  
  538.  
  539.  
  540.           #include <softc.h>
  541.           #include <windows.h>
  542.           
  543.           /* global declarations */
  544.           
  545.           void main()
  546.           {
  547.             /* local declarations */
  548.           
  549.             scinit(20,20);
  550.             .
  551.             .
  552.             .
  553.             /* body of application */
  554.             .
  555.             .
  556.             .
  557.             scterm();
  558.           }
  559.  
  560.  
  561.  
  562.  
  563.  
  564.           The scinit  function must  be the  first function  called in your
  565.               scinit                                                       
  566.           application and  IT MUST  BE CALLED  ONLY ONCE. The last function
  567.                            IT MUST  BE CALLED  ONLY ONCE                   
  568.           should be  scterm. This  is not  a requirement  but  it  is  good
  569.                      scterm                                                
  570.           programming practice.  This function  should be called only once.
  571.           See the  descriptions of these functions in the library reference
  572.           section of this manual.
  573.  
  574.  
  575.           6    Chapter 2, Before You Begin
  576.           6                               
  577.  
  578.  
  579.           Compiling with Turbo C
  580.           Compiling with Turbo C
  581.  
  582.           Turbo C  provides two  ways of compiling programs: the integrated
  583.           environment and  the command  line version. In order to use SoftC
  584.           with the  integrated environment  a project  file must be created
  585.           and the appropriate library must be specified in that file:
  586.  
  587.  
  588.           myprog              /* your program name */
  589.           sctc20s.lib         /* the desired SoftC library */
  590.  
  591.  
  592.           To use  the library with the command line compiler simply include
  593.           the library name in filename list:
  594.  
  595.  
  596.           tcc -f -Ic:\c\include -Lc:\c\lib myprog sctc20s.lib
  597.  
  598.  
  599.           Recompiling the SoftC Libraries
  600.           Recompiling the SoftC Libraries
  601.  
  602.           If you  modify a SoftC source code file, then that module and any
  603.           related modules  (if any)  must be recompiled and replaced in the
  604.           libraries. The  library source  code is  compiled just  like  any
  605.           other SoftC  program. Refer  to your  compiler documentation  for
  606.           instructions for replacing modules in libraries.
  607.  
  608.  
  609.           Function Naming Conventions
  610.           Function Naming Conventions
  611.  
  612.           All SoftC  functions begin  with the  letters "sc".  This  is  to
  613.           differentiate them  from  the  standard  library  functions.  The
  614.           window functions  begin with  "scw",  the  dBase  III  data  file
  615.           functions with  "scd", the  dBase III  index file  functions with
  616.           "sci", and the clock/calendar functions with "scc".
  617.  
  618.  
  619.           
  620.  
  621.  
  622.           Chapter 3
  623.           Chapter 3
  624.  
  625.  
  626.           A Windows Toolkit Tutorial
  627.           A Windows Toolkit Tutorial
  628.  
  629.  
  630.  
  631.  
  632.           Screen I/O  is a major part of almost every computer application.
  633.           Because of  the limited  amount of  space on the screen it is not
  634.           unusual to  run out  of room. Windowing is one way of coping with
  635.           this limitation,  but perhaps  more importantly  it  enables  the
  636.           programmer to  organize  and  present  information  in  a  useful
  637.           manner.
  638.  
  639.  
  640.           If the  concept of  windows is  new to you, think of your desktop
  641.           covered by  pages of paper. Some pages overlap at the edges, some
  642.           are completely hidden by other pages. This is the same thing that
  643.           happens on  your computer screen. Ordinarily the entire screen is
  644.           devoted to  one page  of information.  Using windows you can have
  645.           parts of many pages visible on your screen at once.
  646.  
  647.  
  648.           You can  open and  overlay as  many windows as the memory of your
  649.           computer will  allow. When  you are finished with a window, close
  650.           it and the underlying information is restored.
  651.  
  652.  
  653.           Because each  window is  treated as  a small  screen, all  of the
  654.           window I/O  functions will  work the  same whether windows are in
  655.           use or  not. In  other words, there is no difference in functions
  656.           (or syntax) to print to the physical screen or to a window.
  657.  
  658.  
  659.           Basic Rules
  660.           Basic Rules
  661.  
  662.           In order to benefit fully from the SoftC library, it is necessary
  663.           to use  only the  functions  found  in  the  SoftC  library  when
  664.           performing screen I/O. When standard functions such as printf and
  665.                                                                  printf    
  666.           puts are  used, the  SoftC window manager is bypassed. This means
  667.           puts                                                             
  668.           that it can no longer keep track of the activities in your window
  669.           which can lead to unpredictable results.
  670.  
  671.  
  672.           SoftC has  direct replacements  for many of the standard C screen
  673.           I/O functions  (the following functions will work with or without
  674.           a window):
  675.  
  676.  
  677.           Standard C                                   SoftC
  678.           printf, cprintf                              scwprintf
  679.           printf  cprintf                              scwprintf
  680.           puts, cputs                                  scwputs
  681.           puts  cputs                                  scwputs
  682.           putch, putchar                               scwputc
  683.           putch  putchar                               scwputc
  684.  
  685.  
  686.           8    Chapter 3, A Windows Toolkit Tutorial
  687.           8                                         
  688.  
  689.  
  690.           Also additional  functions have  been added to standardize cursor
  691.           control functions  between compilers  (and in  the future between
  692.           text and  graphics modes) (note that the following functions will
  693.           work with or without a window):
  694.  
  695.  
  696.           Turbo C                                      SoftC
  697.           gotoxy                                       scwgoto
  698.           gotoxy                                       scwgoto
  699.           wherex                                       scwxloc
  700.           wherex                                       scwxloc
  701.           wherey                                       scwyloc
  702.           wherey                                       scwyloc
  703.           clrscr                                       scwclr
  704.           clrscr                                       scwclr
  705.           clreol                                       scwclreol
  706.           clreol                                       scwclreol
  707.           textcolor, textbackground, textattr          scwaput
  708.           textcolor  textbackground  textattr          scwaput
  709.           gettextinfo                                  scwinfo, scwaget
  710.           gettextinfo                                  scwinfo  scwaget
  711.  
  712.  
  713.           Screen Output
  714.           Screen Output
  715.  
  716.           SoftC provides  three  methods  of  outputting  characters  to  a
  717.           window: scwprintf,  scwputs, and scwputc. scwputc and scwputs are
  718.                   scwprintf   scwputs      scwputc  scwputc     scwputs    
  719.           implemented as  macros which  call scwprintf. scwprintf functions
  720.                                              scwprintf  scwprintf          
  721.           the same  as  the  standard  printf  function:  a  format  string
  722.                                        printf                              
  723.           followed by option arguments are passed to the function. One fact
  724.           to be  aware of  is the  string  expansion  limitation  found  in
  725.           scwprintf: the  data to  be displayed  cannot expand  beyond  256
  726.           scwprintf                                                        
  727.           characters including  the terminating NULL byte or the stack will
  728.           be corrupted with potentially disastrous results.
  729.  
  730.  
  731.           Cursor Control
  732.           Cursor Control
  733.  
  734.           The SoftC  screen is  divided into  rows and  columns.  Rows  are
  735.           numbered vertically  down the  screen and  columns  are  numbered
  736.           horizontally across  the screen.  Coordinates of any point on the
  737.           screen can  be expressed in column numbers and row numbers. SoftC
  738.           uses a  coordinate system  where the  column is  listed first and
  739.           then the  row. The  upper left corner of the window is defined by
  740.           the coordinates (1,1) (also known as the home coordinates).
  741.  
  742.  
  743.           The row  number is  hereafter referred  to as the 'y' coordinate,
  744.           and the column number is referred to as the 'x' coordinate.
  745.  
  746.  
  747.           Three types  of cursor control functions exist in SoftC: move the
  748.           cursor to  a new  location, tell  where the  cursor is  currently
  749.           positioned, and  hide/show cursor.  scwgoto is used to reposition
  750.                                               scwgoto                      
  751.           the cursor anywhere on the window. scwxloc and scwyloc return the
  752.                                              scwxloc     scwyloc           
  753.           current cursor  'x' and  'y' coordinates respectively. scwcursoff
  754.                                                                  scwcursoff
  755.           will hide the cursor and scwcurson will show it again.
  756.                                    scwcurson                    
  757.  
  758.  
  759.                                  Chapter 3, A Windows Toolkit Tutorial    9
  760.                                                                           9
  761.  
  762.  
  763.           Erase Functions
  764.           Erase Functions
  765.  
  766.           When the  entire window  or only  a portion  of a line need to be
  767.           cleared, the functions scwclr and scwclreol are used. scwclr will
  768.                                  scwclr     scwclreol           scwclr     
  769.           erase everything  from the  current  window  and  reposition  the
  770.           cursor at  the home  coordinates. scwclreol  will erase  all text
  771.                                             scwclreol                      
  772.           from the current cursor position to the right edge of the window.
  773.           The cursor position will not be changed.
  774.  
  775.  
  776.           Character Colors
  777.           Character Colors
  778.  
  779.           Text  color,   background  color,  and  blinking  attributes  are
  780.           controlled via  scwaput and  scwaget functions. Currently sixteen
  781.                           scwaput      scwaget                             
  782.           colors are  supported: black,  blue, green,  cyan, red,  magenta,
  783.           brown, light  gray, dark  gray, light  blue, light  green,  light
  784.           cyan,  light  red,  light  magenta,  yellow,  and  white.  It  is
  785.           suggested that  you use the SoftC definitions for these colors in
  786.           order to maintain compatibility with other monitors (such as EGA,
  787.           and VGA).
  788.  
  789.  
  790.           Window Control
  791.           Window Control
  792.  
  793.           In order  to use  a window it must first be opened. There are two
  794.           window opening functions: scwopen and scwopenx. scwopen is a high
  795.                                     scwopen     scwopenx  scwopen          
  796.           level function  which requires  only the upper left corner screen
  797.           coordinates (x  and y)  and the  width and  height of the desired
  798.           window. The window colors and style are defaulted to zero (0) and
  799.           there is  no  title.  See  the  window  color  and  border  style
  800.           discussions later in this chapter.
  801.  
  802.  
  803.           scwopenx extends the high level window open by giving you control
  804.           scwopenx                                                         
  805.           over the  window color  and border style, and allows the use of a
  806.           window title.  After  a  window  has  been  opened,  any  of  the
  807.           preceding window  functions (scwputs,  etc.) will work within the
  808.                                        scwputs                             
  809.           confines of that window.
  810.  
  811.  
  812.           Multiple windows  can open at the same time. scwselect provides a
  813.                                                        scwselect           
  814.           mechanism to  switch between  any of  the non-overlaid windows on
  815.           the screen.  The library does not allow the selection of a window
  816.           which is partially covered by another.
  817.  
  818.  
  819.           When you  are finished  with a  window it can be removed from the
  820.           screen and  the underlying  data restored via a call to scwclose.
  821.                                                                   scwclose 
  822.           This function  will also  free up  the memory  allocated for  the
  823.           window being closed.
  824.  
  825.  
  826.           10    Chapter 3, A Windows Toolkit Tutorial
  827.           10                                         
  828.  
  829.  
  830.           At some  point you may need some information about a window, such
  831.           as its size, color scheme, border style, or title length. This is
  832.           accomplished by a call to scwinfo.
  833.                                     scwinfo 
  834.  
  835.  
  836.           Window Colors
  837.           Window Colors
  838.  
  839.           There is a window color scheme array used by SoftC to control the
  840.           colors of the window border, title, and the initial color of text
  841.           printout. The array is large enough to hold color information for
  842.           ten different color schemes. Each element in the array holds text
  843.           color and  background color  information for  each of  the  three
  844.           previously mentioned items.
  845.  
  846.  
  847.           There  are   two  functions   provided  to   access  this   color
  848.           information: scwcget and scwcput. scwcget will retrieve the color
  849.                        scwcget     scwcput  scwcget                        
  850.           scheme and scwcput will set it.
  851.                      scwcput             
  852.  
  853.  
  854.           Window Border Styles
  855.           Window Border Styles
  856.  
  857.           SoftC uses  another array to control the window border style. The
  858.           six characters  used to  make a window are stored in each element
  859.           of the  array:  the  four  corners  of  the  window  as  well  as
  860.           horizontal and  vertical connecting  characters.  This  array  is
  861.           large enough  to hold  four different  border styles.  scwbget is
  862.                                                                  scwbget   
  863.           used to  retrieve border  style information  from the  array, and
  864.           scwbput is used to change it.
  865.           scwbput                      
  866.  
  867.  
  868.           Window Titles
  869.           Window Titles
  870.  
  871.           Control over  the title  of the current window is provided by two
  872.           functions: scwtget  and scwtput.  The title can be easily changed
  873.                      scwtget      scwtput                                  
  874.           via a  call to scwtput. The current window title can be retrieved
  875.                          scwtput                                           
  876.           through a call to scwtget. If you are uncertain as to the size of
  877.                             scwtget                                        
  878.           the title  string a  call to  scwinfo will  tell you how long the
  879.                                         scwinfo                            
  880.           string is including the terminating NULL byte.
  881.  
  882.  
  883.           
  884.  
  885.  
  886.           Chapter 4
  887.           Chapter 4
  888.  
  889.  
  890.           A dBase III Toolkit Tutorial
  891.           A dBase III Toolkit Tutorial
  892.  
  893.  
  894.  
  895.  
  896.           Most applications  need to  do some  file I/O  operations. Your C
  897.           compiler provides  you with  basic functions  to do  general file
  898.           I/O. But  many cases  will arise  when you need to use a database
  899.           within your  application. The SoftC Library provides functions to
  900.           enable you  to integrate  your program  and dBase  III compatible
  901.           data and index files.
  902.  
  903.  
  904.           For those of you who may be unfamiliar with databases, think of a
  905.           filing  cabinet   filled  with   folders  of   invoices   ordered
  906.           alphabetically  by   company  name.   If  we  wish  to  put  this
  907.           information "on  computer" we have two choices for data file I/O:
  908.           a simple sequential file, or a random access file.
  909.  
  910.  
  911.           Sequential Files
  912.           Sequential Files
  913.  
  914.           The concept  of using  a sequential file to store invoice data by
  915.           company name is very simple. Just enter the data as it's found in
  916.           the filing  cabinet. To access the information just begin reading
  917.           at the  start of the file and continue until finished. As you can
  918.           see the time required to find a specific record greatly increases
  919.           as more  and more  records are added to the file. Also the act of
  920.           adding information  to the  file  while  trying  to  keep  it  in
  921.           alphabetical order  becomes very  time consuming  due to the fact
  922.           that many records will have to be moved in order to make room for
  923.           the new record.
  924.  
  925.  
  926.           Random Access Files
  927.           Random Access Files
  928.  
  929.           By using  random access  techniques it  becomes  much  easier  to
  930.           access any  particular data  record. All  that is required is the
  931.           desired record  number and  you can  seek to  the proper location
  932.           within the  data file. But how do you know which record number to
  933.           use? And  what about  adding records  in the  middle of  the data
  934.           file? dBase uses keys and an indexed lookup system called ISAM to
  935.           solve both of these problems.
  936.  
  937.  
  938.           Keys
  939.           Keys
  940.  
  941.           Keys are generally comprised of one or more pieces of information
  942.           (data fields)  found in a data record. In our example the company
  943.           name could  be used as a key. Each key would point to one or more
  944.           records found  in the  data file.  When  many  keys  are  grouped
  945.  
  946.  
  947.           12    Chapter 4, A dBase III Toolkit Tutorial
  948.           12                                           
  949.  
  950.  
  951.           together they  form an  index file. dBase uses a technique called
  952.           ISAM to  access the  underlying B-tree  structure  of  its  index
  953.           files.
  954.  
  955.  
  956.           ISAM and B-trees
  957.           ISAM and B-trees
  958.  
  959.           The relationship between a key and the data file record number is
  960.           established via  a "key  item". Many  key items  are found  on an
  961.           "index page".  Many index  pages are  combined to  form an "index
  962.           file". The  method used  to navigate  through the  index file  is
  963.           called "Indexed  Sequential Access  Method" or  ISAM. B-tree  (or
  964.           branch tree)  is the underlying structure used in ISAM. Searching
  965.           always begins  at the  top of the tree. Each key item on an index
  966.           page  can  point  to  another  index  page  (this  is  where  the
  967.           "branching" comes  into play).  If a  key item  does not point to
  968.           another index  page it  is referred  to as  a "terminal  node". A
  969.           search is ended when a terminal node is encountered.
  970.  
  971.  
  972.           When a  data record  for a specific key needs to be accessed, The
  973.           first (top)  index page is searched with the desired key text. If
  974.           not at  a terminal  node, a  determination will be made using the
  975.           branch trees as to which index page should next be searched. This
  976.           sequence of  searching and branching is followed until a terminal
  977.           node is  encountered. If  an exact match is found the data record
  978.           number found  in that  key item  can be  used to  access the data
  979.           file.
  980.  
  981.  
  982.           When a key needs to be added to an index file, the above sequence
  983.           of searching  and branching  is again followed until the location
  984.           where the  new key  should be  placed is  found. Because  of  the
  985.           nature of the ISAM file it is much easier and faster to add a key
  986.           to the index page than appearances may indicate. If an index page
  987.           overflows it  will be  split  into  two  pages.  Likewise  if  it
  988.           underflows it will be joined with another index page. This system
  989.           results in a minimal amount of file I/O.
  990.  
  991.  
  992.           The first  question above  has been  obviously answered, but what
  993.           about the second? The answer lies in the fact that because we are
  994.           using an  index file  we no  longer have to keep the data file in
  995.           alphabetical order,  all we  need to  do is append records to the
  996.           end of the data file and add a key to the index file.
  997.  
  998.  
  999.           This ends  the general  discussion of  databases. One note, it is
  1000.           good programming  practice to  create keys only from  data fields
  1001.           found in  the data  record, this  allows the reconstruction of an
  1002.           index file should something catastrophic happen.
  1003.  
  1004.  
  1005.                               Chapter 4, A dBase III Toolkit Tutorial    13
  1006.                                                                          13
  1007.  
  1008.  
  1009.           Basic Rules
  1010.           Basic Rules
  1011.  
  1012.           In order to benefit fully from the SoftC library, it is necessary
  1013.           to use  only the  functions found  in the library when performing
  1014.           database I/O.  When standard  functions such as fprintf are used,
  1015.                                                           fprintf          
  1016.           the SoftC database manager is bypassed. This means that it can no
  1017.           longer keep  track of the activities in your database files which
  1018.           can lead to unpredictable results.
  1019.  
  1020.  
  1021.           This is  not to  say that  you cannot use the standard C file I/O
  1022.           functions found  in your  compiler's  libraries,  but  their  use
  1023.           should be restricted to non-database I/O.
  1024.  
  1025.  
  1026.           Data File Functions
  1027.           Data File Functions
  1028.  
  1029.           In order to use a data file it first must be opened. scdopen will
  1030.                                                                scdopen     
  1031.           open any  dBase III or dBase III+ compatible data file. The SoftC
  1032.           database manager file handle will be returned. This handle number
  1033.           must be used for all I/O with that specific data file.
  1034.  
  1035.  
  1036.           When you  are finished  with a  data file  it is good practice to
  1037.           close that  data file  via a call to scdclose. This is true for a
  1038.                                                scdclose                    
  1039.           couple of  reasons: 1)  The data will be safe if your application
  1040.           crashes, and  2) computer  memory will  be freed for other use. A
  1041.           safety net  is provided  by scterm in that it will close all data
  1042.                                       scterm                               
  1043.           and  index   files  as  well  as  any  windows  open  at  program
  1044.           termination.
  1045.  
  1046.  
  1047.           The length  of the data file in bytes can be found using scdsize.
  1048.                                                                    scdsize 
  1049.           The name of the data file associated with a particular handle can
  1050.           be retrieved  via a  call to scdinfo. Also a new data file can be
  1051.                                        scdinfo                             
  1052.           created by scdcreate.
  1053.                      scdcreate 
  1054.  
  1055.  
  1056.           Data Record I/O
  1057.           Data Record I/O
  1058.  
  1059.           Having a data file is of little use unless you can manipulate the
  1060.           individual records. SoftC provides seven functions to: read/write
  1061.           individual records,  delete/recover deleted  records,  manipulate
  1062.           I/O buffers, and retrieve information about the record structure.
  1063.  
  1064.  
  1065.           A data  record can  be read from the data file using scdrget. The
  1066.                                                                scdrget     
  1067.           actual data  will be  placed in  a SoftC internal buffer. See the
  1068.           discussion on  Data Field  I/O for  more information on accessing
  1069.           the individual  fields found in a data record. When a data record
  1070.           needs to  be written  to the  file, scdrput  should be used. This
  1071.                                               scdrput                      
  1072.           function is  used both  for the  changing of  a record as well as
  1073.           adding new records.
  1074.  
  1075.  
  1076.           14    Chapter 4, A dBase III Toolkit Tutorial
  1077.           14                                           
  1078.  
  1079.  
  1080.           dBase III  data records  are not physically removed from the data
  1081.           file when  they are  deleted. This enables the user to change his
  1082.           mind and recover the deleted records for use again. SoftC follows
  1083.           this guideline  by providing  the scdrdel function to mark a data
  1084.                                             scdrdel                        
  1085.           record as  deleted, and  the scdrundel  function to  recover  the
  1086.                                        scdrundel                           
  1087.           record (or mark as active).
  1088.  
  1089.  
  1090.           Information about the data record structure can be retrieved by a
  1091.           called to  scdrinfo. The  record length,  number of fields in the
  1092.                      scdrinfo                                              
  1093.           data record, and the addresses of the I/O buffers can be obtained
  1094.           in this way.
  1095.  
  1096.  
  1097.           Two additional functions are provided which deal exclusively with
  1098.           the  internal   SoftC  I/O   buffers:  scdrclear,  and  scdrcopy.
  1099.                                                  scdrclear        scdrcopy 
  1100.           scdrclear is  useful in clearing the output buffer before placing
  1101.           scdrclear                                                        
  1102.           data in the individual fields. The entire data record will be set
  1103.           to spaces (" "). This has the effect on numeric fields of placing
  1104.           nothing in  the field  rather than  zero. scdrcopy  can be useful
  1105.                                                     scdrcopy               
  1106.           when a  record needs to be updated but the original also needs to
  1107.           be retained.
  1108.  
  1109.  
  1110.           Data Field I/O
  1111.           Data Field I/O
  1112.  
  1113.           The six  data  field  manipulation  functions  provide  for:  the
  1114.           writing of  data to  a field in the output buffer, the reading of
  1115.           data from  a field  in the  input buffer, the conversion of field
  1116.           names  to   field  numbers,   and  the  retrieval  of  the  field
  1117.           descriptions originally setup with scdcreate.
  1118.                                              scdcreate 
  1119.  
  1120.  
  1121.           There are  two types  of field  I/O: standard  C types and ASCIIZ
  1122.           string. scdfput  and scdfget  use the  standard C  types below to
  1123.                   scdfput      scdfget                                     
  1124.           place data  in and  retrieve data  from individual  fields  in  a
  1125.           record. scdfput  attempts to  properly  format  the  data  before
  1126.                   scdfput                                                  
  1127.           placing it  in the  field. This  means that  the proper number of
  1128.           spaces,  zeros,   and/or  a   decimal  point  will  be  added  as
  1129.           appropriate.
  1130.  
  1131.  
  1132.           C types                  dBase III types
  1133.           char [8]                 date
  1134.           ASCIIZ string            character
  1135.           double                   numeric
  1136.           char                     logical
  1137.  
  1138.  
  1139.           scdfputs and  scdfgets use ASCIIZ strings exclusively. It is left
  1140.           scdfputs      scdfgets                                           
  1141.           up to  the users  of these  functions to  ensure that the data is
  1142.           properly formatted. Both "scdfput" functions work with the output
  1143.           buffer, and the "scdfget" functions work with the input buffer.
  1144.  
  1145.  
  1146.                               Chapter 4, A dBase III Toolkit Tutorial    15
  1147.                                                                          15
  1148.  
  1149.  
  1150.           A field name to field number translation function (scdfnam2no) is
  1151.                                                              scdfnam2no    
  1152.           provided to  isolate your  application from  the structure of the
  1153.           data files.
  1154.  
  1155.  
  1156.           Index File Functions
  1157.           Index File Functions
  1158.  
  1159.           In order  to use  an index  file it first must be opened. sciopen
  1160.                                                                     sciopen
  1161.           will open  any dBase III or dBase III+ compatible index file. The
  1162.           index files  created by Clipper are not compatible with dBase III
  1163.           (and thusly  with SoftC).  The SoftC database manager file handle
  1164.           will be  returned. This  handle number  must be  used for all I/O
  1165.           with that specific index file.
  1166.  
  1167.  
  1168.           When you  are finished with an index file, it can be closed via a
  1169.           call to  scdclose. Information  about the  index file such as the
  1170.                    scdclose                                                
  1171.           file name  and length of the key expression can be retrieved by a
  1172.           call to  sciinfo. A  new index  file can  be created by using the
  1173.                    sciinfo                                                 
  1174.           function scicreate.
  1175.                    scicreate 
  1176.  
  1177.  
  1178.           sciexpr can  be used to get the actual index key expression. This
  1179.           sciexpr                                                          
  1180.           key expression  is generally  a formula  listing the  field names
  1181.           used to make the index key. For example, FIRST_NAME and LAST_NAME
  1182.           are both  fields found  in a  data file, if an index key was made
  1183.           from the  combination of these fields the key expression could be
  1184.           "LAST_NAME + FIRST_NAME".
  1185.  
  1186.  
  1187.           Index Page Functions
  1188.           Index Page Functions
  1189.  
  1190.           If memory  is available  the SoftC database manager will allocate
  1191.           space for  ten index  pages. In some instances more or less pages
  1192.           may be  needed to  provide  fast  access  to  index  information.
  1193.           scipinfo is  used to  find out how many pages for which space was
  1194.           scipinfo                                                         
  1195.           allocated. To  change the  number of  pages for  which memory was
  1196.           allocated, scipnum can be used.
  1197.                      scipnum             
  1198.  
  1199.  
  1200.           Index Key Functions
  1201.           Index Key Functions
  1202.  
  1203.           Nine functions  have been  provided for  use in:  finding a  key,
  1204.           moving to  the next  or  previous  key,  adding/deleting  a  key,
  1205.           retrieving the  current key,  and building a key. There are three
  1206.           search functions  supported: find  first key (scikfirst), finding
  1207.                                                         scikfirst          
  1208.           the last  key  (sciklast),  and  searching  for  a  specific  key
  1209.                           sciklast                                         
  1210.           (scikfind). The  keys found  in this  manner become  the "current
  1211.            scikfind                                                        
  1212.           key". Wildcards such as "?" and "*" cannot be used.
  1213.  
  1214.  
  1215.           Once a particular key is found it is often desired to get the key
  1216.           following (sciknext)  or the  key preceding  (scikprev) it. These
  1217.                      sciknext                           scikprev           
  1218.  
  1219.  
  1220.           16    Chapter 4, A dBase III Toolkit Tutorial
  1221.           16                                           
  1222.  
  1223.  
  1224.           keys, if  found, become  the current  key.  Another  function  is
  1225.           provided to return the current key, scikcur.
  1226.                                               scikcur 
  1227.  
  1228.  
  1229.           It also  desirable to  be able  to add  and delete  keys from the
  1230.           index file.  scikadd and  scikdel provide  these functions. These
  1231.                        scikadd      scikdel                                
  1232.           functions also  attempt to  keep the B-tree balanced, so that one
  1233.           branch of the tree will not grow larger than the others.
  1234.  
  1235.  
  1236.           dBaseIII provides  certain functions  which may  be used in a key
  1237.           expression. scikmake will build a key for you using the index key
  1238.                       scikmake                                             
  1239.           expression and  the contents  of the  current output buffer. This
  1240.           function supports  five of  the more  common dBaseIII  functions:
  1241.           dtoc, left, right, str, and substr.
  1242.           dtoc  left  right  str      substr 
  1243.  
  1244.  
  1245.           
  1246.  
  1247.  
  1248.           Chapter 5
  1249.           Chapter 5
  1250.  
  1251.  
  1252.           Clock & Calendar Functions
  1253.           Clock & Calendar Functions
  1254.  
  1255.  
  1256.  
  1257.  
  1258.           This chapter will describe the clock and date functions available
  1259.           in  the   SoftC  Library.   Currently  only  nine  functions  are
  1260.           implemented and they are all are date manipulators. Note that the
  1261.           date format  is "yyyymmdd"  for all  functions  unless  otherwise
  1262.           specified.
  1263.  
  1264.  
  1265.           Internal to dBaseIII the date fields are formatted as "yyyymmdd".
  1266.           This format  enables the  date field  to be  used properly  as an
  1267.           index key and ensures that the date February 13, 1989 will always
  1268.           be larger  than the  date December  15, 1988. Note that this date
  1269.           format is  not the  one normally used when entering or displaying
  1270.           dates. If  fact dBaseIII  uses the date format "mm/dd/yy" when it
  1271.           displays dates.
  1272.  
  1273.  
  1274.           A function  sccdxlat was created to allow switching between these
  1275.                       sccdxlat                                             
  1276.           two formats.  An additional format is provided to enable the year
  1277.           section of  the  date  to  more  accurately  represent  the  year
  1278.           entered. This format is "mm/dd/yyyy".
  1279.  
  1280.  
  1281.           Quite often  some calculations  will need to be performed on date
  1282.           strings and two functions are provided for this purpose. sccddiff
  1283.                                                                    sccddiff
  1284.           calculates the  difference between  two date strings for you, and
  1285.           sccds2n will  convert the  date string into three integers: year,
  1286.           sccds2n                                                          
  1287.           month, and  day so you can do your own calculations. sccdn2s will
  1288.                                                                sccdn2s     
  1289.           convert from three integers back to a string.
  1290.  
  1291.  
  1292.           Two functions  are  provided  to  test  for  leap  year.  sccleap
  1293.                                                                     sccleap
  1294.           requires a  date string and sccleapi uses an integer. To check if
  1295.                                       sccleapi                             
  1296.           a  given  date  string  is  valid  sccdvalid  can  be  used.  Two
  1297.                                              sccdvalid                     
  1298.           additional functions  are provided  for displaying  text strings:
  1299.           sccday is  used to  get the  day of  the week string and sccmonth
  1300.           sccday                                                   sccmonth
  1301.           returns the month string.
  1302.  
  1303.  
  1304.           
  1305.  
  1306.  
  1307.           Chapter 6
  1308.           Chapter 6
  1309.  
  1310.  
  1311.           Miscellaneous Functions
  1312.           Miscellaneous Functions
  1313.  
  1314.  
  1315.  
  1316.  
  1317.           This chapter  will describe  the miscellaneous functions found in
  1318.           the SoftC library.
  1319.  
  1320.  
  1321.           scinit sets  up the  SoftC window  and database  managers. Memory
  1322.           scinit                                                           
  1323.           will be  allocated for  a  variety  of  internal  structures.  As
  1324.           previously mentioned  this function should be called only once at
  1325.           the beginning of your application. scterm is called at the end of
  1326.                                              scterm                        
  1327.           your application.  It will  close all  windows and database files
  1328.           and free the memory allocated by scinit.
  1329.                                            scinit 
  1330.  
  1331.  
  1332.           The  scvers  function  has  been  provided  to  retrieve  a  NULL
  1333.                scvers                                                      
  1334.           terminated character  string containing  the version of the SoftC
  1335.           library you  are currently  using. This  can then  be printed  by
  1336.           scwputs.
  1337.           scwputs 
  1338.  
  1339.  
  1340.           A global  variable sc_code  will contain  the results of the last
  1341.                              sc_code                                       
  1342.           SoftC function  call executed.  Errors are  indicated by negative
  1343.           numbers, warnings  by positive  numbers greater  than zero, and a
  1344.           zero  indicates   success.  During   program  debug   it  may  be
  1345.           advantageous to  print  the  text  message  associated  with  the
  1346.           contents of  sc_code. scemsg  will  return  the  address  of  the
  1347.                        sc_code  scemsg                                     
  1348.           message associated  with the  contents of sc_code, which can then
  1349.                                                     sc_code                
  1350.           be printed by scwputs.
  1351.                         scwputs 
  1352.  
  1353.  
  1354.           If you  desire to  clear an error or warning condition either the
  1355.           global variable sc_code can be set to zero or the function sceclr
  1356.                           sc_code                                    sceclr
  1357.           can be used. It is preferable to use the function rather than the
  1358.           global variable.
  1359.  
  1360.  
  1361.           
  1362.  
  1363.  
  1364.           Chapter 7
  1365.           Chapter 7
  1366.  
  1367.  
  1368.           The SoftC Library
  1369.           The SoftC Library
  1370.  
  1371.  
  1372.  
  1373.  
  1374.           This chapter  contains a  detailed description  of  each  of  the
  1375.           functions in the SoftC library.
  1376.  
  1377.  
  1378.           The following  sample function  description explains  how to  use
  1379.           this portion of the SoftC Library Reference Manual.
  1380.  
  1381.  
  1382.           function name
  1383.           function name
  1384.           _____________
  1385.  
  1386.  
  1387.  
  1388.  
  1389.           Usage
  1390.           Usage
  1391.           _____
  1392.                     function(modifier parameter[,...]);
  1393.                     function                           
  1394.                                       _________        
  1395.  
  1396.  
  1397.                     The declaration  syntax for  function, parameter  names
  1398.                                                  function                  
  1399.                                                            _________       
  1400.                     are  italicized.   The  [,...]   indicates  that  other
  1401.                     parameters and their modifiers may follow.
  1402.  
  1403.  
  1404.           Prototype in
  1405.           Prototype in
  1406.           ____________
  1407.                     This lists  the header  files in  which the function is
  1408.                     prototyped.
  1409.  
  1410.  
  1411.           Description
  1412.           Description
  1413.           ___________
  1414.                     This describes  what function  does, the  parameters it
  1415.                     takes, and  any  details  you  need  in  order  to  use
  1416.                     function and the related routines listed.
  1417.  
  1418.  
  1419.           See also
  1420.           See also
  1421.           ________
  1422.                     Routines related  to function that you may wish to read
  1423.                     about are listed here.
  1424.  
  1425.  
  1426.           Return Value
  1427.           Return Value
  1428.           ____________
  1429.                     The value(s)  that function returns (if any) are listed
  1430.                     here. The  return value  will also  be set  in sc_code.
  1431.                                                                    sc_code 
  1432.                     Unless  otherwise   noted  in   the  specific  function
  1433.                     description, the  function  call  will  be  ignored  if
  1434.                     sc_code contains  an error  (values less  than zero). A
  1435.                     sc_code                                                
  1436.                     good return  will always  be equal to zero. Any warning
  1437.                     codes are always greater than zero.
  1438.  
  1439.  
  1440.           20    Chapter 7, The SoftC Library
  1441.           20                                
  1442.  
  1443.  
  1444.           Example
  1445.           Example
  1446.           _______
  1447.                     A sample  program listing demonstrating how function is
  1448.                     used.
  1449.  
  1450.  
  1451.                                          Chapter 7, The SoftC Library    21
  1452.                                                                          21
  1453.  
  1454.  
  1455.           sccday
  1456.           sccday
  1457.           ______
  1458.  
  1459.  
  1460.  
  1461.  
  1462.           Usage
  1463.           Usage
  1464.           _____
  1465.                     signed short int sccday( signed char day,
  1466.                                      sccday                  
  1467.                                                          ___ 
  1468.                                              signed char daystr[10] );
  1469.                                                          ______       
  1470.  
  1471.  
  1472.           Prototype in
  1473.           Prototype in
  1474.           ____________
  1475.                     SoftC.h
  1476.  
  1477.  
  1478.           Description
  1479.           Description
  1480.           ___________
  1481.                     sccday returns the day of the week string in daystr for
  1482.                     sccday                                                 
  1483.                                                                  ______    
  1484.                     the day specified by day. day must be in the range of 0
  1485.                                          ___  ___                          
  1486.                     (Sunday) to  6 (Saturday).  The maximum  length of  the
  1487.                     string returned will be 9 plus the NULL byte.
  1488.  
  1489.  
  1490.           See also
  1491.           See also
  1492.           ________
  1493.                     sccmonth
  1494.                     sccmonth
  1495.  
  1496.  
  1497.           Return Value
  1498.           Return Value
  1499.           ____________
  1500.                     SC_SUCCESS     function successful
  1501.                     SC_BADDATE     invalid date
  1502.  
  1503.  
  1504.           Example
  1505.           Example
  1506.           _______
  1507.  
  1508.           #include "SoftC.h"
  1509.           
  1510.           void main()
  1511.           {
  1512.             char day[10];
  1513.           
  1514.             scinit(1,1);
  1515.             sccday(0,day);
  1516.             scwputs(day);
  1517.             scterm();
  1518.           }
  1519.  
  1520.  
  1521.           22    Chapter 7, The SoftC Library
  1522.           22                                
  1523.  
  1524.  
  1525.           sccddiff
  1526.           sccddiff
  1527.           ________
  1528.  
  1529.  
  1530.  
  1531.  
  1532.           Usage
  1533.           Usage
  1534.           _____
  1535.                     signed short int sccddiff( signed char *date1,
  1536.                                      sccddiff                     
  1537.                                                             _____ 
  1538.                                              signed char *date2,
  1539.                                                           _____ 
  1540.                                              signed long *diff );
  1541.                                                           ____   
  1542.  
  1543.  
  1544.           Prototype in
  1545.           Prototype in
  1546.           ____________
  1547.                     SoftC.h
  1548.  
  1549.  
  1550.           Description
  1551.           Description
  1552.           ___________
  1553.                     sccddiff returns  the difference  in days between date1
  1554.                     sccddiff                                               
  1555.                                                                       _____
  1556.                     and date2.  The two  date strings  can be in any order,
  1557.                         _____                                              
  1558.                     but must  be valid   dates of the format "yyyymmdd" (eg
  1559.                     "19890213"). This is the date format used internally by
  1560.                     the SoftC  database manager.  sccdxlat can  be used  to
  1561.                                                   sccdxlat                 
  1562.                     translate an  existing date string to this format, or a
  1563.                     date string can be built using sccdn2s.
  1564.                                                    sccdn2s 
  1565.  
  1566.  
  1567.           See also
  1568.           See also
  1569.           ________
  1570.                     sccdxlat, sccdn2s, sccdvalid.
  1571.                     sccdxlat  sccdn2s  sccdvalid 
  1572.  
  1573.  
  1574.           Return Value
  1575.           Return Value
  1576.           ____________
  1577.                     SC_SUCCESS     calculation successful
  1578.                     SC_BADDATE     invalid date
  1579.  
  1580.  
  1581.           Example
  1582.           Example
  1583.           _______
  1584.  
  1585.           #include "SoftC.h"
  1586.           
  1587.           void main()
  1588.           {
  1589.             signed long d;
  1590.           
  1591.             scinit(1,1);
  1592.             sccddiff("19890213","19881217",&d);
  1593.             scwprintf("%ld",d);
  1594.             scterm();
  1595.           }
  1596.  
  1597.  
  1598.                                          Chapter 7, The SoftC Library    23
  1599.                                                                          23
  1600.  
  1601.  
  1602.           sccdn2s
  1603.           sccdn2s
  1604.           _______
  1605.  
  1606.  
  1607.  
  1608.  
  1609.           Usage
  1610.           Usage
  1611.           _____
  1612.                     signed short int sccdn2s( signed int year,
  1613.                                      sccdn2s                  
  1614.                                                         _____ 
  1615.                                              signed int month,
  1616.                                                         _____ 
  1617.                                              signed int day,
  1618.                                                        ____ 
  1619.                                              signed char *string );
  1620.                                                           ______   
  1621.  
  1622.  
  1623.           Prototype in
  1624.           Prototype in
  1625.           ____________
  1626.                     SoftC.h
  1627.  
  1628.  
  1629.           Description
  1630.           Description
  1631.           ___________
  1632.                     sccdn2s  converts  three  integer  date  values  (year,
  1633.                     sccdn2s                                                
  1634.                                                                       ____ 
  1635.                     month, and  day) into  a character  string (string).  A
  1636.                     _____       ___                             ______     
  1637.                     check is  made to  verify that  string is  a valid date
  1638.                                                     ______                 
  1639.                     string before exiting.
  1640.  
  1641.  
  1642.           See also
  1643.           See also
  1644.           ________
  1645.                     sccdvalid, sccds2n.
  1646.                     sccdvalid  sccds2n 
  1647.  
  1648.  
  1649.           Return Value
  1650.           Return Value
  1651.           ____________
  1652.                     SC_SUCCESS     conversion successful
  1653.                     SC_BADDATE     invalid date
  1654.  
  1655.  
  1656.           Example
  1657.           Example
  1658.           _______
  1659.  
  1660.           #include "SoftC.h"
  1661.           
  1662.           void main()
  1663.           {
  1664.             signed char d[9];
  1665.           
  1666.             scinit(1,1);
  1667.             sccdn2s(1989,2,13,d);
  1668.             scwputs(d);
  1669.             scterm();
  1670.           }
  1671.  
  1672.  
  1673.           24    Chapter 7, The SoftC Library
  1674.           24                                
  1675.  
  1676.  
  1677.           sccds2n
  1678.           sccds2n
  1679.           _______
  1680.  
  1681.  
  1682.  
  1683.  
  1684.           Usage
  1685.           Usage
  1686.           _____
  1687.                     signed short int sccds2n( signed char *string,
  1688.                                      sccds2n                      
  1689.                                                            ______ 
  1690.                                              signed int *year,
  1691.                                                        _ ____ 
  1692.                                              signed int *month,
  1693.                                                          _____ 
  1694.                                              signed int *day );
  1695.                                                        _ ___   
  1696.  
  1697.  
  1698.           Prototype in
  1699.           Prototype in
  1700.           ____________
  1701.                     SoftC.h
  1702.  
  1703.  
  1704.           Description
  1705.           Description
  1706.           ___________
  1707.                     sccds2n converts dates from a character string (string)
  1708.                     sccds2n                                                
  1709.                                                                     ______ 
  1710.                     to three  integer values  (year,  month,  and  day).  A
  1711.                                                ____   _____        ___     
  1712.                     partial check  is made to verify that string is a valid
  1713.                                                           ______           
  1714.                     date string before attempting to convert.
  1715.  
  1716.  
  1717.           See also
  1718.           See also
  1719.           ________
  1720.                     sccdn2s.
  1721.                     sccdn2s 
  1722.  
  1723.  
  1724.           Return Value
  1725.           Return Value
  1726.           ____________
  1727.                     SC_SUCCESS     conversion successful
  1728.                     SC_BADDATE     invalid date
  1729.  
  1730.  
  1731.           Example
  1732.           Example
  1733.           _______
  1734.  
  1735.           #include "SoftC.h"
  1736.           
  1737.           void main()
  1738.           {
  1739.             signed int y, m, d;
  1740.           
  1741.             scinit(1,1);
  1742.             sccds2n("19890213",&y,&m,&d);
  1743.             scwprintf("%d %d %d",y,m,d);
  1744.             scterm();
  1745.           }
  1746.  
  1747.  
  1748.                                          Chapter 7, The SoftC Library    25
  1749.                                                                          25
  1750.  
  1751.  
  1752.           sccdvalid
  1753.           sccdvalid
  1754.           _________
  1755.  
  1756.  
  1757.  
  1758.  
  1759.           Usage
  1760.           Usage
  1761.           _____
  1762.                     signed char sccdvalid( signed char *string );
  1763.                                 sccdvalid                        
  1764.                                                         ______   
  1765.  
  1766.  
  1767.           Prototype in
  1768.           Prototype in
  1769.           ____________
  1770.                     SoftC.h
  1771.  
  1772.  
  1773.           Description
  1774.           Description
  1775.           ___________
  1776.                     sccdvalid tests  the date  string (string)  passed  for
  1777.                     sccdvalid                                              
  1778.                                                        ______              
  1779.                     validity: string properly formatted ("yyyymmdd"), valid
  1780.                     day of month, valid month of year.
  1781.  
  1782.  
  1783.           Return Value
  1784.           Return Value
  1785.           ____________
  1786.                     TRUE      valid date
  1787.                     FALSE     invalid date
  1788.  
  1789.  
  1790.           Example
  1791.           Example
  1792.           _______
  1793.  
  1794.           #include "SoftC.h"
  1795.           
  1796.           void main()
  1797.           {
  1798.             scinit(1,1);
  1799.             if (sccdvalid("19890213"))
  1800.               scwputs("Good Date.");
  1801.             else
  1802.               scwputs("Bad Date.");
  1803.             scterm();
  1804.           }
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.           sccdxlat
  1811.           sccdxlat
  1812.           ________
  1813.  
  1814.  
  1815.  
  1816.  
  1817.           Usage
  1818.           Usage
  1819.           _____
  1820.                     signed short int sccdxlat( signed char method,
  1821.                                      sccdxlat                     
  1822.                                                            ______ 
  1823.                                              signed char *source,
  1824.                                                           ______ 
  1825.                                              signed char *dest );
  1826.                                                           ____   
  1827.  
  1828.  
  1829.           26    Chapter 7, The SoftC Library
  1830.           26                                
  1831.  
  1832.  
  1833.           Prototype in
  1834.           Prototype in
  1835.           ____________
  1836.                     SoftC.h
  1837.  
  1838.  
  1839.           Description
  1840.           Description
  1841.           ___________
  1842.                     sccdxlat translates  from one  date  string  format  to
  1843.                     sccdxlat                                               
  1844.                     another  under   control  of  method.  Currently  three
  1845.                                                   ______                   
  1846.                     translation methods  are supported:  SC_2ASCII  -  from
  1847.                     "yyyymmdd" to  "mm/dd/yy", SC_2ASCIIL - from "yyyymmdd"
  1848.                     to "mm/dd/yyyy", and SC_2DBASE - from "mm/dd/[yy]yy" to
  1849.                     "yyyymmdd".
  1850.  
  1851.  
  1852.                     The  maximum   lengths  of   dest  and  source  are  10
  1853.                                                  ____       ______         
  1854.                     characters (plus the NULL byte).
  1855.  
  1856.  
  1857.                     Note that when converting using SC_2DBASE dates such as
  1858.                     "2/1/89" will be translated to "19890201".
  1859.  
  1860.  
  1861.           Return Value
  1862.           Return Value
  1863.           ____________
  1864.                     SC_SUCCESS     translation successful
  1865.                     SC_BADCMD      invalid translation method
  1866.                                                        ______
  1867.                     SC_BADDATE     invalid date
  1868.  
  1869.  
  1870.           Example
  1871.           Example
  1872.           _______
  1873.  
  1874.           #include "SoftC.h"
  1875.           
  1876.           void main()
  1877.           {
  1878.             char date[11];
  1879.           
  1880.             scinit(1,1);
  1881.             sccdxlat(SC_2ASCII,"2/1/89",date);
  1882.             scwputs(date);
  1883.             scterm();
  1884.           }
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.           sccleap
  1891.           sccleap
  1892.           _______
  1893.  
  1894.  
  1895.  
  1896.  
  1897.           Usage
  1898.           Usage
  1899.           _____
  1900.                     signed char sccleap( signed char *leap );
  1901.                                 sccleap                      
  1902.                                                       ____   
  1903.  
  1904.  
  1905.                                          Chapter 7, The SoftC Library    27
  1906.                                                                          27
  1907.  
  1908.  
  1909.           Prototype in
  1910.           Prototype in
  1911.           ____________
  1912.                     SoftC.h
  1913.  
  1914.  
  1915.           Description
  1916.           Description
  1917.           ___________
  1918.                     sccleap tests  the string  year passed to it in leap to
  1919.                     sccleap                                                
  1920.                                                                     ____   
  1921.                     see if it is a leap year.
  1922.  
  1923.  
  1924.           See also
  1925.           See also
  1926.           ________
  1927.                     sccleapi
  1928.                     sccleapi
  1929.  
  1930.  
  1931.           Return Value
  1932.           Return Value
  1933.           ____________
  1934.                     TRUE           year was a leap year
  1935.                     FALSE          year was not a leap year
  1936.  
  1937.  
  1938.           Example
  1939.           Example
  1940.           _______
  1941.  
  1942.           #include "SoftC.h"
  1943.           
  1944.           void main()
  1945.           {
  1946.           
  1947.             scinit(1,1);
  1948.             if (sccleap("1989")
  1949.               scwputs("Leap Year!");
  1950.             else
  1951.               scwputs("Normal Year.");
  1952.             scterm();
  1953.           }
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.           sccleapi
  1960.           sccleapi
  1961.           ________
  1962.  
  1963.  
  1964.  
  1965.  
  1966.           Usage
  1967.           Usage
  1968.           _____
  1969.                     signed char sccleapi( signed int leap );
  1970.                                 sccleapi                    
  1971.                                                      ____   
  1972.  
  1973.  
  1974.           Prototype in
  1975.           Prototype in
  1976.           ____________
  1977.                     SoftC.h
  1978.  
  1979.  
  1980.           Description
  1981.           Description
  1982.           ___________
  1983.                     sccleapi tests the integer year passed to it in leap to
  1984.                     sccleapi                                               
  1985.                                                                     ____   
  1986.                     see if it is a leap year.
  1987.  
  1988.  
  1989.           28    Chapter 7, The SoftC Library
  1990.           28                                
  1991.  
  1992.  
  1993.           See also
  1994.           See also
  1995.           ________
  1996.                     sccleap
  1997.                     sccleap
  1998.  
  1999.  
  2000.           Return Value
  2001.           Return Value
  2002.           ____________
  2003.                     TRUE           year was a leap year
  2004.                     FALSE          year was not a leap year
  2005.  
  2006.  
  2007.           Example
  2008.           Example
  2009.           _______
  2010.  
  2011.           #include "SoftC.h"
  2012.           
  2013.           void main()
  2014.           {
  2015.           
  2016.             scinit(1,1);
  2017.             if (sccleap(1989)
  2018.               scwputs("Leap Year!");
  2019.             else
  2020.               scwputs("Normal Year.");
  2021.             scterm();
  2022.           }
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.           sccmonth
  2029.           sccmonth
  2030.           ________
  2031.  
  2032.  
  2033.  
  2034.  
  2035.           Usage
  2036.           Usage
  2037.           _____
  2038.                     signed short int sccmonth( signed char month,
  2039.                                      sccmonth                    
  2040.                                                            _____ 
  2041.                                              signed char monthstr[10] );
  2042.                                                          ________       
  2043.  
  2044.  
  2045.           Prototype in
  2046.           Prototype in
  2047.           ____________
  2048.                     SoftC.h
  2049.  
  2050.  
  2051.           Description
  2052.           Description
  2053.           ___________
  2054.                     sccmonth returns  the month  string in monthstr for the
  2055.                     sccmonth                                               
  2056.                                                            ________        
  2057.                     month specified by month. month must be in the range of
  2058.                                        _____  _____                        
  2059.                     1 (January) to 12 (December). The maximum length of the
  2060.                     string returned will be 9 plus the NULL byte.
  2061.  
  2062.  
  2063.           See also
  2064.           See also
  2065.           ________
  2066.                     sccday
  2067.                     sccday
  2068.  
  2069.  
  2070.                                          Chapter 7, The SoftC Library    29
  2071.                                                                          29
  2072.  
  2073.  
  2074.           Return Value
  2075.           Return Value
  2076.           ____________
  2077.                     SC_SUCCESS     function successful
  2078.                     SC_BADDATE     invalid date
  2079.  
  2080.  
  2081.           Example
  2082.           Example
  2083.           _______
  2084.  
  2085.           #include "SoftC.h"
  2086.           
  2087.           void main()
  2088.           {
  2089.             char month[10];
  2090.           
  2091.             scinit(1,1);
  2092.             sccmonth(0,month);
  2093.             scwputs(month);
  2094.             scterm();
  2095.           }
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.           scdclose
  2102.           scdclose
  2103.           ________
  2104.  
  2105.  
  2106.  
  2107.  
  2108.           Usage
  2109.           Usage
  2110.           _____
  2111.                     signed short int scdclose( signed char handle );
  2112.                                      scdclose                       
  2113.                                                            ______   
  2114.  
  2115.  
  2116.           Prototype in
  2117.           Prototype in
  2118.           ____________
  2119.                     dbase.h
  2120.  
  2121.  
  2122.           Description
  2123.           Description
  2124.           ___________
  2125.                     scdclose closes  a .DBF  file and  frees all  allocated
  2126.                     scdclose                                               
  2127.                     memory associated with .DBF file handle.
  2128.  
  2129.  
  2130.           See also
  2131.           See also
  2132.           ________
  2133.                     scdopen
  2134.                     scdopen
  2135.  
  2136.  
  2137.           Return Value
  2138.           Return Value
  2139.           ____________
  2140.                     SC_SUCCESS     .DBF file closed
  2141.                     SC_CLOSFAIL    file close failure
  2142.                     SC_BADHNDL     .DBF file not open or bad handle
  2143.  
  2144.  
  2145.           30    Chapter 7, The SoftC Library
  2146.           30                                
  2147.  
  2148.  
  2149.           Example
  2150.           Example
  2151.           _______
  2152.  
  2153.           #include "SoftC.h"
  2154.           #include "dbase.h"
  2155.           
  2156.           void main()
  2157.           {
  2158.             char dbf;
  2159.           
  2160.             scinit(20,20);
  2161.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS)
  2162.               scdclose(dbf);
  2163.             scterm();
  2164.           }
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.           scdcreate
  2171.           scdcreate
  2172.           _________
  2173.  
  2174.  
  2175.  
  2176.  
  2177.           Usage
  2178.           Usage
  2179.           _____
  2180.                     signed short int scdcreate( signed char *filename,
  2181.                                      scdcreate                        
  2182.                                                              ________ 
  2183.                                                 signed char numfields,
  2184.                                                             _________ 
  2185.                                                 SC_FIELD fields[]);
  2186.                                                          ______    
  2187.  
  2188.  
  2189.           Prototype in
  2190.           Prototype in
  2191.           ____________
  2192.                     dbase.h
  2193.  
  2194.  
  2195.           Description
  2196.           Description
  2197.           ___________
  2198.                     scdcreate creates a .DBF file. A pointer to an array of
  2199.                     scdcreate                                              
  2200.                     SC_FIELD must be passed.
  2201.  
  2202.  
  2203.                     typedef struct {
  2204.                       signed char name[11];  /* field name */
  2205.                       signed char type;      /* field type */
  2206.                       unsigned char len;     /* field length */
  2207.                       unsigned char decpl;   /* decimal places */
  2208.                     } SC_FIELD;
  2209.                       SC_FIELD 
  2210.  
  2211.  
  2212.                     The field  description array  must be  initialized  and
  2213.                     each element  set  to  appropriate  values.  The  array
  2214.                     determines the  organization of a data record. The .DBF
  2215.                     file does not remain open upon exit of this function.
  2216.  
  2217.  
  2218.                                          Chapter 7, The SoftC Library    31
  2219.                                                                          31
  2220.  
  2221.  
  2222.                     This function  will create  a new .DBF file even if one
  2223.                     had already existed.
  2224.  
  2225.  
  2226.                     Field names  and types  are converted to all upper case
  2227.                     when the file is created.
  2228.  
  2229.  
  2230.                     Restrictions:  DBaseIII:
  2231.                     maximum record length is 4000 bytes.
  2232.                     maximum number of fields is 128.
  2233.                     maximum length of character fields is 254.
  2234.                     
  2235.                                    SoftC:
  2236.                     maximum length of numeric fields is 19 this includes
  2237.                     the decimal point and the sign .
  2238.                     length of date field is forced to 8.
  2239.                     length of logical fields is forced to 1.
  2240.                     the decimal places will be forced to zero for all types
  2241.                     except NUMERIC in which case it must be less then 'len'
  2242.                     - 2.
  2243.  
  2244.  
  2245.           Return Value
  2246.           Return Value
  2247.           ____________
  2248.                     SC_SUCCESS     .DBF file created
  2249.                     SC_WRTFAIL     disk write failure
  2250.                     SC_BADFLD      user supplied field description bad
  2251.                     SC_NOHNDL      no DOS file handles available
  2252.  
  2253.  
  2254.           Example
  2255.           Example
  2256.           _______
  2257.  
  2258.           #include "SoftC.h"
  2259.           #include "dbase.h"
  2260.           
  2261.           void main()
  2262.           {
  2263.             SC_FIELD fields[4] = {
  2264.               "character",'c',16,0,     /* character field */
  2265.               "date",'d',8,0,           /* date field */
  2266.               "logical",'l',1,0,        /* logical field */
  2267.               "numeric",'n',6,2         /* numeric field */
  2268.             };
  2269.           
  2270.             scinit(20,20);
  2271.             scdcreate("TEST.DBF",4,fields);
  2272.             scterm();
  2273.           }
  2274.  
  2275.  
  2276.           32    Chapter 7, The SoftC Library
  2277.           32                                
  2278.  
  2279.  
  2280.           scdfget
  2281.           scdfget
  2282.           _______
  2283.  
  2284.  
  2285.  
  2286.  
  2287.           Usage
  2288.           Usage
  2289.           _____
  2290.                     signed short int scdfget( signed char handle,
  2291.                                      scdfget                     
  2292.                                                           ______ 
  2293.                                               signed char fieldno,
  2294.                                                           _______ 
  2295.                                               void *data );
  2296.                                                     ____   
  2297.  
  2298.  
  2299.           Prototype in
  2300.           Prototype in
  2301.           ____________
  2302.                     dbase.h
  2303.  
  2304.  
  2305.           Description
  2306.           Description
  2307.           ___________
  2308.                     scdfget gets  data from  the desired field (fieldno) of
  2309.                     scdfget                                                
  2310.                                                                 _______    
  2311.                     the input  buffer. data will be converted from DBaseIII
  2312.                     to a more natural data type for 'c':
  2313.  
  2314.  
  2315.                     DBaseIII field type      returned data type
  2316.                          'C'                      signed char *
  2317.                          'D'                      signed char [9]
  2318.                          'L'                      signed char
  2319.                          'N'                      double
  2320.  
  2321.  
  2322.                     scdfinfo can  be used  to determine  the length  of the
  2323.                     scdfinfo                                               
  2324.                     longest data field in the file.
  2325.  
  2326.  
  2327.                     Note that  date fields  are returned as NULL terminated
  2328.                     character  strings   in  the   form:  "mm/dd/yy",   and
  2329.                     character  fields   are  returned  as  NULL  terminated
  2330.                     character strings.
  2331.  
  2332.  
  2333.           See also
  2334.           See also
  2335.           ________
  2336.                     scdfgets,  scdfput, scdfinfo, scdrget.
  2337.                     scdfgets   scdfput  scdfinfo  scdrget 
  2338.  
  2339.  
  2340.           Return Value
  2341.           Return Value
  2342.           ____________
  2343.                     SC_SUCCESS     retrieved data from field
  2344.                     SC_BADHNDL     .DBF file not open or bad handle
  2345.                     SC_BADFLD      invalid data record field number
  2346.  
  2347.  
  2348.           Example
  2349.           Example
  2350.           _______
  2351.  
  2352.           #include "SoftC.h"
  2353.           #include "dbase.h"
  2354.           #include "windows.h"
  2355.           
  2356.  
  2357.  
  2358.                                          Chapter 7, The SoftC Library    33
  2359.                                                                          33
  2360.  
  2361.  
  2362.           void main()
  2363.           {
  2364.             char dbf, character[17],logical,date[9];
  2365.             double numeric;
  2366.           
  2367.             scinit(20,20);
  2368.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  2369.               scdrget(dbf,1L);
  2370.               scdfgets(dbf,0,character);
  2371.               scdfget(dbf,1,(void *) date);
  2372.               scdfget(dbf,2,(void *) &logical);
  2373.               scdfget(dbf,3,(void *) &numeric);
  2374.               scwprintf("%s %s %c %lf\n",
  2375.                 character,date,logical,numeric);
  2376.               scdclose(dbf);
  2377.             }
  2378.             scterm();
  2379.           }
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.           scdfgets
  2386.           scdfgets
  2387.           ________
  2388.  
  2389.  
  2390.  
  2391.  
  2392.           Usage
  2393.           Usage
  2394.           _____
  2395.                     signed short int scdfgets( signed char handle,
  2396.                                      scdfgets                     
  2397.                                                            _______
  2398.                                                signed char fieldno,
  2399.                                                            _______ 
  2400.                                                char *data );
  2401.                                                      ____   
  2402.  
  2403.  
  2404.           Prototype in
  2405.           Prototype in
  2406.           ____________
  2407.                     dbase.h
  2408.  
  2409.  
  2410.           Description
  2411.           Description
  2412.           ___________
  2413.                     scdfgets gets  data from the desired field (fieldno) of
  2414.                     scdfgets                                               
  2415.                                                                 _______    
  2416.                     the input  buffer. data  will be  returned as an ASCIIZ
  2417.                                        ____                                
  2418.                     string.
  2419.  
  2420.  
  2421.                     scdfinfo can  be used  to determine  the length  of the
  2422.                     scdfinfo                                               
  2423.                     longest data field in the file.
  2424.  
  2425.  
  2426.                     Note  that   date  fields  are  returned  in  the  form
  2427.                     "yyyymmdd". There  is a  difference  between  the  date
  2428.                     formats of scdfgets and scdfget.
  2429.                                scdfgets     scdfget 
  2430.  
  2431.  
  2432.           34    Chapter 7, The SoftC Library
  2433.           34                                
  2434.  
  2435.  
  2436.           See also
  2437.           See also
  2438.           ________
  2439.                     scdfget,  scdfputs, scdfinfo, scdrget.
  2440.                     scdfget   scdfputs  scdfinfo  scdrget 
  2441.  
  2442.  
  2443.           Return Value
  2444.           Return Value
  2445.           ____________
  2446.                     SC_SUCCESS     retrieved data from field
  2447.                     SC_BADHNDL     .DBF file not open or bad handle
  2448.                     SC_BADFLD      invalid data record field number
  2449.  
  2450.  
  2451.           Example
  2452.           Example
  2453.           _______
  2454.  
  2455.           #include "SoftC.h"
  2456.           #include "dbase.h"
  2457.           #include "windows.h"
  2458.           
  2459.           void main()
  2460.           {
  2461.             char dbf, character[17] = "Hello",
  2462.                  logical = 'F', date[9] = "12/25/88";
  2463.             double numeric = 150.00L;
  2464.           
  2465.             scinit(20,20);
  2466.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  2467.               scdrget(dbf,1L);
  2468.               scdfgets(dbf,0,character);
  2469.               scdfgets(dbf,1,date);
  2470.               scdfget(dbf,2,(void *) &logical);
  2471.               scdfget(dbf,3,(void *) &numeric);
  2472.               scwprintf("%s %s %c %lf\n",
  2473.                 character,date,logical,numeric);
  2474.               scdclose(dbf);
  2475.             }
  2476.             scterm();
  2477.           }
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.           scdfinfo
  2484.           scdfinfo
  2485.           ________
  2486.  
  2487.  
  2488.  
  2489.  
  2490.           Usage
  2491.           Usage
  2492.           _____
  2493.                     signed short int scdfinfo( signed char handle,
  2494.                                      scdfinfo                     
  2495.                                                            ______ 
  2496.                                                signed char *longfldlen,
  2497.                                                             __________ 
  2498.                                                SC_FIELD *fields );
  2499.                                                          ______   
  2500.  
  2501.  
  2502.           Prototype in
  2503.           Prototype in
  2504.           ____________
  2505.                     dbase.h
  2506.  
  2507.  
  2508.                                          Chapter 7, The SoftC Library    35
  2509.                                                                          35
  2510.  
  2511.  
  2512.           Description
  2513.           Description
  2514.           ___________
  2515.                     scdfinfo copies  the .DBF  field descriptions to fields
  2516.                     scdfinfo                                               
  2517.                                                                      ______
  2518.                     using the structure SC_FIELD. The length of the longest
  2519.                                         SC_FIELD                           
  2520.                     data field is also returned (longfldlen).
  2521.                                                  __________  
  2522.  
  2523.  
  2524.                     typedef struct {
  2525.                       signed char name[11];  /* field name */
  2526.                       signed char type;      /* field type */
  2527.                       unsigned char len;     /* field length */
  2528.                       unsigned char decpl;   /* decimal places */
  2529.                     } SC_FIELD;
  2530.                       SC_FIELD 
  2531.  
  2532.  
  2533.                     The user  must ensure that the array defined for fields
  2534.                     is large  enough to  hold all of the field descriptions
  2535.                     because scdfinfo  blindly copies  the  descriptions  to
  2536.                             scdfinfo                                       
  2537.                     fields. Severe  program errors can be the result if the
  2538.                     field array is too small. Use scdrinfo to determine the
  2539.                                                   scdrinfo                 
  2540.                     number of fields in the data record.
  2541.  
  2542.  
  2543.           See also
  2544.           See also
  2545.           ________
  2546.                     scdrinfo
  2547.                     scdrinfo
  2548.  
  2549.  
  2550.           Return Value
  2551.           Return Value
  2552.           ____________
  2553.                     SC_SUCCESS     returned the field descriptions
  2554.                     SC_BADHNDL     .DBF file not open or bad handle
  2555.  
  2556.  
  2557.           Example
  2558.           Example
  2559.           _______
  2560.  
  2561.           #include "SoftC.h"
  2562.           #include "dbase.h"
  2563.           #include "windows.h"
  2564.           
  2565.           void main()
  2566.           {
  2567.             char dbf, longfld, numflds, a;
  2568.             SC_FIELD fields[128];  /* dBaseIII max size */
  2569.             short reclen;
  2570.             void *ibfr, *obfr;
  2571.           
  2572.             scinit(20,20);
  2573.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  2574.               scdrinfo(dbf,&reclen,&numflds,&ibfr,&obfr);
  2575.               scdfinfo(dbf,&longfld,fields);
  2576.               scwprintf("longest field length = %d\n",longfld);
  2577.               for (a = 0; a < numflds; a++)
  2578.                 scwprintf("%s %c %d %d\n", fields[a].name, fields[a].type,
  2579.                     fields[a].len, fields[a].decpl);
  2580.               scdclose(dbf);
  2581.             }
  2582.  
  2583.  
  2584.           36    Chapter 7, The SoftC Library
  2585.           36                                
  2586.  
  2587.  
  2588.             scterm();
  2589.           }
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.           scdfnam2no
  2596.           scdfnam2no
  2597.           __________
  2598.  
  2599.  
  2600.  
  2601.  
  2602.           Usage
  2603.           Usage
  2604.           _____
  2605.                     signed short int scdfnam2no( signed char handle,
  2606.                                      scdfnam2no                     
  2607.                                                              ______ 
  2608.                                                  signed char *fieldname,
  2609.                                                               _________ 
  2610.                                                  signed char *fieldno );
  2611.                                                               _______   
  2612.  
  2613.  
  2614.           Prototype in
  2615.           Prototype in
  2616.           ____________
  2617.                     dbase.h
  2618.  
  2619.  
  2620.           Description
  2621.           Description
  2622.           ___________
  2623.                     scdfnam2no searches through the field description array
  2624.                     scdfnam2no                                             
  2625.                     for .DBF  file handle  looking for  fieldname. It  will
  2626.                                                         _________          
  2627.                     return the corresponding field number.
  2628.  
  2629.  
  2630.                     Note that  .DBF files  created by SoftC will have field
  2631.                     names changed to all upper case.
  2632.  
  2633.  
  2634.           Return Value
  2635.           Return Value
  2636.           ____________
  2637.                     SC_SUCCESS     field number returned
  2638.                     SC_BADHNDL     .DBF file not open or bad handle
  2639.                     SC_BADFLD      invalid data record field name
  2640.  
  2641.  
  2642.           Example
  2643.           Example
  2644.           _______
  2645.  
  2646.           #include "SoftC.h"
  2647.           #include "dbase.h"
  2648.           #include "windows.h"
  2649.           
  2650.           void main()
  2651.           {
  2652.             char dbf, fldno
  2653.           
  2654.             scinit(20,20);
  2655.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  2656.               scdfnam2no(dbf,"LOGICAL",&fldno);
  2657.               scwprintf("%d",fldno);
  2658.               scdclose(dbf);
  2659.             }
  2660.  
  2661.  
  2662.                                          Chapter 7, The SoftC Library    37
  2663.                                                                          37
  2664.  
  2665.  
  2666.             scterm();
  2667.           }
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.           scdfput
  2674.           scdfput
  2675.           _______
  2676.  
  2677.  
  2678.  
  2679.  
  2680.           Usage
  2681.           Usage
  2682.           _____
  2683.                     signed short int scdfput( signed char handle,
  2684.                                      scdfput                     
  2685.                                                           ______ 
  2686.                                               signed char fieldno,
  2687.                                                           _______ 
  2688.                                               void *data );
  2689.                                                     ____   
  2690.  
  2691.  
  2692.           Prototype in
  2693.           Prototype in
  2694.           ____________
  2695.                     dbase.h
  2696.  
  2697.  
  2698.           Description
  2699.           Description
  2700.           ___________
  2701.                     scdfput will  convert data  from 'c' format to dBaseIII
  2702.                     scdfput                                                
  2703.                                           ____                             
  2704.                     format and  place it  in the  proper field (fieldno) of
  2705.                                                                 _______    
  2706.                     the output buffer.
  2707.  
  2708.  
  2709.                     Field numbers  begin with  zero (0).  If the  field  is
  2710.                     numeric, data should be passed as a double.
  2711.                              ____                              
  2712.  
  2713.  
  2714.                     Note that  scdfput follows the date formatting standard
  2715.                                scdfput                                     
  2716.                     of scdfget.  It is  optional to  include the  "19" from
  2717.                        scdfget                                             
  2718.                     "1989" as  this is  assumed, however  the date "2/1/00"
  2719.                     will become  "19000201" even  if you had intended it to
  2720.                     be  "20000201".   Date  strings  can  be  formatted  as
  2721.                     "2/1/2000" to overcome this problem.
  2722.  
  2723.  
  2724.           See also
  2725.           See also
  2726.           ________
  2727.                     scdfget, scdfputs.
  2728.                     scdfget  scdfputs 
  2729.  
  2730.  
  2731.           Return Value
  2732.           Return Value
  2733.           ____________
  2734.                     SC_SUCCESS     data placed in field
  2735.                     SC_BADHNDL     .DBF file not open or bad handle
  2736.                     SC_BADFLD      invalid data record field number
  2737.  
  2738.  
  2739.           Example
  2740.           Example
  2741.           _______
  2742.  
  2743.           #include "SoftC.h"
  2744.           #include "dbase.h"
  2745.  
  2746.  
  2747.           38    Chapter 7, The SoftC Library
  2748.           38                                
  2749.  
  2750.  
  2751.           #include "windows.h"
  2752.           
  2753.           void main()
  2754.           {
  2755.             char dbf, logical = 'T', date[9] = "12/25/88";
  2756.             long recno;
  2757.             double numeric = 20.0L;
  2758.           
  2759.             scinit(20,20);
  2760.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  2761.               scdfputs(dbf,0,"SoftC Library   ");
  2762.               scdfput(dbf,1,(void *) date);
  2763.               scdfput(dbf,2,(void *) &logical);
  2764.               scdfput(dbf,3,(void *) &numeric);
  2765.               scdrput(dbf,SC_ADD,&recno);
  2766.               scwprintf("Record number = %ld\n",recno);
  2767.               scdclose(dbf);
  2768.             }
  2769.             scterm();
  2770.           }
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.           scdfputs
  2777.           scdfputs
  2778.           ________
  2779.  
  2780.  
  2781.  
  2782.  
  2783.           Usage
  2784.           Usage
  2785.           _____
  2786.                     signed short int scdfputs( signed char handle,
  2787.                                      scdfputs                     
  2788.                                                            ______ 
  2789.                                               signed char fieldno,
  2790.                                                           _______ 
  2791.                                               char *data );
  2792.                                                     ____   
  2793.  
  2794.  
  2795.           Prototype in
  2796.           Prototype in
  2797.           ____________
  2798.                     dbase.h
  2799.  
  2800.  
  2801.           Description
  2802.           Description
  2803.           ___________
  2804.                     scdfputs will  place data in the proper field (fieldno)
  2805.                     scdfputs                                               
  2806.                                          ____                      _______ 
  2807.                     of the  output buffer.  It is the user's responsibility
  2808.                     to provide a properly sized and formatted ASCIIZ string
  2809.                     to scdfputs.
  2810.                        scdfputs 
  2811.  
  2812.  
  2813.                     Field numbers  begin with  zero (0).  If the  field  is
  2814.                     numeric, data should be passed as a double.
  2815.                              ____                              
  2816.  
  2817.  
  2818.                     Note  that   scdfputs  follows   the  date   formatting
  2819.                                  scdfputs                                  
  2820.                     conventions of  scdfgets. Also  be aware  that the date
  2821.                                     scdfgets                               
  2822.  
  2823.  
  2824.                                          Chapter 7, The SoftC Library    39
  2825.                                                                          39
  2826.  
  2827.  
  2828.                     formatting conventions  of scdfget/scdfput  are not the
  2829.                                                scdfget scdfput             
  2830.                     same as scdfgets/scdfputs.
  2831.                             scdfgets scdfputs 
  2832.  
  2833.  
  2834.           See also
  2835.           See also
  2836.           ________
  2837.                     scdfgets, scdfput.
  2838.                     scdfgets  scdfput 
  2839.  
  2840.  
  2841.           Return Value
  2842.           Return Value
  2843.           ____________
  2844.                     SC_SUCCESS     data placed in field
  2845.                     SC_BADHNDL     .DBF file not open or bad handle
  2846.                     SC_BADFLD      invalid data record field number
  2847.  
  2848.  
  2849.           Example
  2850.           Example
  2851.           _______
  2852.  
  2853.           #include "SoftC.h"
  2854.           #include "dbase.h"
  2855.           #include "windows.h"
  2856.           
  2857.           void main()
  2858.           {
  2859.             char dbf, logical,date[9];
  2860.             long recno;
  2861.             double numeric;
  2862.           
  2863.             scinit(20,20);
  2864.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  2865.               scdfputs(dbf,0,"SoftC Library   ");
  2866.               scdfputs(dbf,1, date);
  2867.               scdfput(dbf,2,(void *) &logical);
  2868.               scdfput(dbf,3,(void *) &numeric);
  2869.               scdrput(dbf,SC_ADD,&recno);
  2870.               scwprintf("Record number = %ld\n",recno);
  2871.               scdclose(dbf);
  2872.             }
  2873.             scterm();
  2874.           }
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.           scdinfo
  2881.           scdinfo
  2882.           _______
  2883.  
  2884.  
  2885.  
  2886.  
  2887.           Usage
  2888.           Usage
  2889.           _____
  2890.                     signed short int scdinfo( signed char handle,
  2891.                                      scdinfo                     
  2892.                                                           ______ 
  2893.                                               signed char *filename );
  2894.                                                            ________   
  2895.  
  2896.  
  2897.           40    Chapter 7, The SoftC Library
  2898.           40                                
  2899.  
  2900.  
  2901.           Prototype in
  2902.           Prototype in
  2903.           ____________
  2904.                     dbase.h
  2905.  
  2906.  
  2907.           Description
  2908.           Description
  2909.           ___________
  2910.                     scdinfo gets  the name  of  the  file  associated  with
  2911.                     scdinfo                                                
  2912.                     handle.
  2913.                     ______ 
  2914.  
  2915.  
  2916.           See also
  2917.           See also
  2918.           ________
  2919.                     scdopen
  2920.                     scdopen
  2921.  
  2922.  
  2923.           Return Value
  2924.           Return Value
  2925.           ____________
  2926.                     SC_SUCCESS     returned the file name
  2927.                     SC_BADHNDL     .DBF file not open or bad handle
  2928.  
  2929.  
  2930.           Example
  2931.           Example
  2932.           _______
  2933.  
  2934.           #include <dir.h>
  2935.           #include "SoftC.h"
  2936.           #include "dbase.h"
  2937.           #include "windows.h"
  2938.           
  2939.           void main()
  2940.           {
  2941.             char dbf;
  2942.             char filename[MAXPATH];
  2943.           
  2944.             scinit(20,20);
  2945.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  2946.               scdinfo(dbf,filename);
  2947.               scwprintf("%s",filename);
  2948.               scdclose(dbf);
  2949.             }
  2950.             scterm();
  2951.           }
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.           scdopen
  2958.           scdopen
  2959.           _______
  2960.  
  2961.  
  2962.  
  2963.  
  2964.           Usage
  2965.           Usage
  2966.           _____
  2967.                     signed short int scdopen( signed char *handle,
  2968.                                      scdopen                      
  2969.                                                            ______ 
  2970.                                               signed char *filename );
  2971.                                                            ________   
  2972.  
  2973.  
  2974.                                          Chapter 7, The SoftC Library    41
  2975.                                                                          41
  2976.  
  2977.  
  2978.           Prototype in
  2979.           Prototype in
  2980.           ____________
  2981.                     dbase.h
  2982.  
  2983.  
  2984.           Description
  2985.           Description
  2986.           ___________
  2987.                     scdopen opens a .DBF file. Memory will be allocated for
  2988.                     scdopen                                                
  2989.                     a file packet and I/O buffers for use internally by the
  2990.                     SoftC file manager.
  2991.  
  2992.  
  2993.           Return Value
  2994.           Return Value
  2995.           ____________
  2996.                     SC_SUCCESS     file opened and memory allocated
  2997.                     SC_MEMERR      memory allocation failure
  2998.                     SC_NOFILE      .DBF file not found
  2999.                     SC_RDFAIL      disk read failure
  3000.                     SC_NODBF       file not in .DBF format
  3001.                     SC_SKFAIL      disk seek failure
  3002.                     SC_NOHNDL      no SoftC file handles available
  3003.                     SC_BADFNAME    invalid filename
  3004.  
  3005.  
  3006.           Example
  3007.           Example
  3008.           _______
  3009.  
  3010.           #include "SoftC.h"
  3011.           #include "dbase.h"
  3012.           
  3013.           void main()
  3014.           {
  3015.             char dbf;
  3016.           
  3017.             scinit(20,20);
  3018.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS)
  3019.               scdclose(dbf);
  3020.           
  3021.             scterm();
  3022.           }
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.           scdrclear
  3029.           scdrclear
  3030.           _________
  3031.  
  3032.  
  3033.  
  3034.  
  3035.           Usage
  3036.           Usage
  3037.           _____
  3038.                     signed short int scdrclear( signed char handle,
  3039.                                      scdrclear                     
  3040.                                                             ______ 
  3041.                                                 signed short int buffer );
  3042.                                                                  ______   
  3043.  
  3044.  
  3045.           Prototype in
  3046.           Prototype in
  3047.           ____________
  3048.                     dbase.h
  3049.  
  3050.  
  3051.           42    Chapter 7, The SoftC Library
  3052.           42                                
  3053.  
  3054.  
  3055.           Description
  3056.           Description
  3057.           ___________
  3058.                     scdrclear clears  a .DBF  I/O buffer.  buffer indicates
  3059.                     scdrclear                                              
  3060.                                                            ______          
  3061.                     which record buffer to clear.
  3062.  
  3063.  
  3064.                     buffer =       clears this buffer
  3065.                     SC_INPUT            input
  3066.                     SC_OUTPUT           output
  3067.  
  3068.  
  3069.           Return Value
  3070.           Return Value
  3071.           ____________
  3072.                     SC_SUCCESS     buffer cleared
  3073.                     SC_BADHNDL     .DBF file not open or bad handle
  3074.                     SC_BADCMD      invalid buffer
  3075.  
  3076.  
  3077.           Example
  3078.           Example
  3079.           _______
  3080.  
  3081.           #include "SoftC.h"
  3082.           #include "dbase.h"
  3083.           #include "windows.h"
  3084.           
  3085.           void main()
  3086.           {
  3087.             char dbf, character[17] = "Hello World!";
  3088.           
  3089.             scinit(20,20);
  3090.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  3091.               scdfputs(dbf,0,"SoftC Library   ");
  3092.               scdrclear(dbf,SC_INPUT);
  3093.               scdrcopy(dbf,SC_OUTPUT);
  3094.               scdfgets(dbf,0,character);
  3095.               scwprintf("%s\n",character);
  3096.             }
  3097.             scterm();
  3098.           }
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.           scdrcopy
  3105.           scdrcopy
  3106.           ________
  3107.  
  3108.  
  3109.  
  3110.  
  3111.           Usage
  3112.           Usage
  3113.           _____
  3114.                     signed short int scdrcopy( signed char handle,
  3115.                                      scdrcopy                     
  3116.                                                            ______ 
  3117.                                                signed short int buffer );
  3118.                                                                 ______   
  3119.  
  3120.  
  3121.           Prototype in
  3122.           Prototype in
  3123.           ____________
  3124.                     dbase.h
  3125.  
  3126.  
  3127.                                          Chapter 7, The SoftC Library    43
  3128.                                                                          43
  3129.  
  3130.  
  3131.           Description
  3132.           Description
  3133.           ___________
  3134.                     scdrcopy copies  the contents  of one I/O buffer to the
  3135.                     scdrcopy                                               
  3136.                     other. buffer indicates the direction of the copy.
  3137.                            ______                                     
  3138.  
  3139.  
  3140.                     buffer =       copies this way
  3141.                     SC_INPUT            input to output
  3142.                     SC_OUTPUT           output to input
  3143.  
  3144.  
  3145.           Return Value
  3146.           Return Value
  3147.           ____________
  3148.                     SC_SUCCESS     buffer copy
  3149.                     SC_BADHNDL     .DBF file not open or bad handle
  3150.                     SC_BADCMD      invalid buffer
  3151.  
  3152.  
  3153.           Example
  3154.           Example
  3155.           _______
  3156.  
  3157.           #include "SoftC.h"
  3158.           #include "dbase.h"
  3159.           #include "windows.h"
  3160.           
  3161.           void main()
  3162.           {
  3163.             char dbf, character[17] = "Hello World!";
  3164.           
  3165.             scinit(20,20);
  3166.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  3167.               scdfputs(dbf,0,"SoftC Library   ");
  3168.               scdrclear(dbf,SC_INPUT);
  3169.               scdrcopy(dbf,SC_OUTPUT);
  3170.               scdfgets(dbf,0,character);
  3171.               scwprintf("%s\n",character);
  3172.               scdclose(dbf);
  3173.             }
  3174.             scterm();
  3175.           }
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.           scdrdel
  3182.           scdrdel
  3183.           _______
  3184.  
  3185.  
  3186.  
  3187.  
  3188.           Usage
  3189.           Usage
  3190.           _____
  3191.                     signed short int scdrdel( signed char handle,
  3192.                                      scdrdel                     
  3193.                                                           ______ 
  3194.                                               signed long int recno );
  3195.                                                               _____   
  3196.  
  3197.  
  3198.           Prototype in
  3199.           Prototype in
  3200.           ____________
  3201.                     dbase.h
  3202.  
  3203.  
  3204.           44    Chapter 7, The SoftC Library
  3205.           44                                
  3206.  
  3207.  
  3208.           Description
  3209.           Description
  3210.           ___________
  3211.                     scdrdel will  flag  a  record  specified  by  recno  as
  3212.                     scdrdel                                                
  3213.                                                                   _____    
  3214.                     'deleted'. To  maintain compatibility with dBaseIII the
  3215.                     data record cannot be reused, but it can be 'undeleted'
  3216.                     by scdrundel.
  3217.                        scdrundel 
  3218.  
  3219.  
  3220.           See also
  3221.           See also
  3222.           ________
  3223.                     scdrundel.
  3224.                     scdrundel 
  3225.  
  3226.  
  3227.           Return Value
  3228.           Return Value
  3229.           ____________
  3230.                     SC_SUCCESS     record marked 'deleted'
  3231.                     SC_BADHNDL     .DBF file not open or bad handle
  3232.                     SC_SKFAIL      invalid data record number or disk seek
  3233.                                    failure
  3234.                     SC_RDFAIL      disk read failure
  3235.                     SC_WRTFAIL     disk write failure
  3236.  
  3237.  
  3238.           Example
  3239.           Example
  3240.           _______
  3241.  
  3242.           #include "SoftC.h"
  3243.           #include "dbase.h"
  3244.           #include "windows.h"
  3245.           
  3246.           void main()
  3247.           {
  3248.             char dbf;
  3249.           
  3250.             scinit(20,20);
  3251.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  3252.               scdrdel(dbf,1L);
  3253.               scdrget(dbf,1L);
  3254.               scwprintf("%s\n",scemsg());
  3255.               scdclose(dbf);
  3256.             }
  3257.             scterm();
  3258.           }
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.           scdrget
  3265.           scdrget
  3266.           _______
  3267.  
  3268.  
  3269.  
  3270.  
  3271.           Usage
  3272.           Usage
  3273.           _____
  3274.                     signed short int scdrget( signed char handle,
  3275.                                      scdrget                     
  3276.                                                           ______ 
  3277.                                               signed long int recno );
  3278.                                                               _____   
  3279.  
  3280.  
  3281.                                          Chapter 7, The SoftC Library    45
  3282.                                                                          45
  3283.  
  3284.  
  3285.           Prototype in
  3286.           Prototype in
  3287.           ____________
  3288.                     dbase.h
  3289.  
  3290.  
  3291.           Description
  3292.           Description
  3293.           ___________
  3294.                     scdrget will  read the  data record  specified by recno
  3295.                     scdrget                                                
  3296.                                                                       _____
  3297.                     from the  .DBF file  associated with  handle  into  the
  3298.                     internal input buffer.
  3299.  
  3300.  
  3301.           See also
  3302.           See also
  3303.           ________
  3304.                     scdfget, scdfputs, scdrget.
  3305.                     scdfget  scdfputs  scdrget 
  3306.  
  3307.  
  3308.           Return Value
  3309.           Return Value
  3310.           ____________
  3311.                     SC_SUCCESS     record read
  3312.                     SC_BADHNDL     .DBF file not open or bad handle
  3313.                     SC_SKFAIL      invalid data record number or disk seek
  3314.                                    failure
  3315.                     SC_RDFAIL      disk read failure
  3316.                     SC_DELREC      record read was marked 'deleted'
  3317.  
  3318.  
  3319.           Example
  3320.           Example
  3321.           _______
  3322.  
  3323.           #include "SoftC.h"
  3324.           #include "dbase.h"
  3325.           #include "windows.h"
  3326.           
  3327.           void main()
  3328.           {
  3329.             char dbf, character[17] = "Hello",
  3330.                  logical = 'F', date[9] = "12/25/88";
  3331.             double numeric = 150.00L;
  3332.           
  3333.             scinit(20,20);
  3334.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  3335.               scdrget(dbf,1L);
  3336.               scdfgets(dbf,0,character);
  3337.               scdfgets(dbf,1,date);
  3338.               scdfget(dbf,2,(void *) &logical);
  3339.               scdfget(dbf,3,(void *) &numeric);
  3340.               scwprintf("%s %s %c %lf\n",
  3341.                 character,date,logical,numeric);
  3342.               scdclose(dbf);
  3343.             }
  3344.             scterm();
  3345.           }
  3346.  
  3347.  
  3348.           46    Chapter 7, The SoftC Library
  3349.           46                                
  3350.  
  3351.  
  3352.           scdrinfo
  3353.           scdrinfo
  3354.           ________
  3355.  
  3356.  
  3357.  
  3358.  
  3359.           Usage
  3360.           Usage
  3361.           _____
  3362.                     signed short int scdrinfo( signed char handle,
  3363.                                      scdrinfo                     
  3364.                                                            ______ 
  3365.                                                signed long int *reclen,
  3366.                                                                 ______ 
  3367.                                                signed char *numflds,
  3368.                                                             _______ 
  3369.                                                void **ibfr,
  3370.                                                       ____ 
  3371.                                                void **obfr );
  3372.                                                       ____   
  3373.  
  3374.  
  3375.           Prototype in
  3376.           Prototype in
  3377.           ____________
  3378.                     dbase.h
  3379.  
  3380.  
  3381.           Description
  3382.           Description
  3383.           ___________
  3384.                     scdrinfo gets  the data  record  length  (reclen),  the
  3385.                     scdrinfo                                               
  3386.                                                               ______       
  3387.                     number of  data fields  per record  (numflds), and  the
  3388.                                                          _______           
  3389.                     addresses  of   the  input  (ibfr)  and  output  (obfr)
  3390.                                                  ____                 ____ 
  3391.                     buffers.
  3392.  
  3393.  
  3394.           Return Value
  3395.           Return Value
  3396.           ____________
  3397.                     SC_SUCCESS     requested information returned
  3398.                     SC_BADHNDL     .DBF file not open or bad handle
  3399.  
  3400.  
  3401.           Example
  3402.           Example
  3403.           _______
  3404.  
  3405.           #include "SoftC.h"
  3406.           #include "dbase.h"
  3407.           #include "windows.h"
  3408.           
  3409.           void main()
  3410.           {
  3411.             char dbf, numflds;
  3412.             short reclen;
  3413.             void *ibfr, *obfr;
  3414.           
  3415.             scinit(20,20);
  3416.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  3417.               scdrinfo(dbf,&reclen,&numflds,&ibfr,&obfr);
  3418.               scwprintf("Record length = %d\n",reclen);
  3419.               scwprintf("Number of fields = %d\n",numflds);
  3420.               scwprintf("I/O buffers = %p %p\n",ibfr,obfr);
  3421.               scdclose(dbf);
  3422.             }
  3423.             scterm();
  3424.           }
  3425.  
  3426.  
  3427.                                          Chapter 7, The SoftC Library    47
  3428.                                                                          47
  3429.  
  3430.  
  3431.           scdrput
  3432.           scdrput
  3433.           _______
  3434.  
  3435.  
  3436.  
  3437.  
  3438.           Usage
  3439.           Usage
  3440.           _____
  3441.                     signed short int scdrput( signed char handle,
  3442.                                      scdrput                     
  3443.                                                           ______ 
  3444.                                               signed short int howto,
  3445.                                                                _____ 
  3446.                                               signed long int *recno );
  3447.                                                                _____   
  3448.  
  3449.  
  3450.           Prototype in
  3451.           Prototype in
  3452.           ____________
  3453.                     dbase.h
  3454.  
  3455.  
  3456.           Description
  3457.           Description
  3458.           ___________
  3459.                     scdrput will  write the  data record specified by recno
  3460.                     scdrput                                                
  3461.                                                                       _____
  3462.                     to the  .DBF  file  associated  with  handle  from  the
  3463.                                                           ______           
  3464.                     internal output  buffer. howto  determines how the data
  3465.                                              _____                         
  3466.                     record is to be written:
  3467.  
  3468.  
  3469.                     howto =        action
  3470.                     SC_ADD           record appended to end of file
  3471.                     SC_UPDATE        current record updated
  3472.  
  3473.  
  3474.                     If a  record update is occurring the data record number
  3475.                     associated with  the record in the input buffer will be
  3476.                     returned. An  update will not be performed if the input
  3477.                     buffer is  empty. Use  scdrget to load a data record or
  3478.                                            scdrget                         
  3479.                     scdfput or  scdfputs to  fill the  data record field by
  3480.                     scdfput     scdfputs                                   
  3481.                     field.
  3482.  
  3483.  
  3484.           See also
  3485.           See also
  3486.           ________
  3487.                     scdfput, scdfputs, scdrget.
  3488.                     scdfput  scdfputs  scdrget 
  3489.  
  3490.  
  3491.           Return Value
  3492.           Return Value
  3493.           ____________
  3494.                     SC_SUCCESS     record read
  3495.                     SC_BADHNDL     .DBF file not open or bad handle
  3496.                     SC_SKFAIL      invalid data record number or disk seek
  3497.                                    failure
  3498.                     SC_WRTFAIL     disk write failure
  3499.                     SC_BADCMD      invalid record write command
  3500.  
  3501.  
  3502.           Example
  3503.           Example
  3504.           _______
  3505.  
  3506.           #include "SoftC.h"
  3507.           #include "dbase.h"
  3508.           #include "windows.h"
  3509.           
  3510.  
  3511.  
  3512.           48    Chapter 7, The SoftC Library
  3513.           48                                
  3514.  
  3515.  
  3516.           void main()
  3517.           {
  3518.             char dbf, logical = 'T', date[9] = "19881225";
  3519.             long recno;
  3520.             double numeric = 20.0L;
  3521.           
  3522.             scinit(20,20);
  3523.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  3524.               scdfputs(dbf,0,"SoftC Library   ");
  3525.               scdfput(dbf,1,(void *) date);
  3526.               scdfput(dbf,2,(void *) &logical);
  3527.               scdfput(dbf,3,(void *) &numeric);
  3528.               scdrput(dbf,SC_ADD,&recno);
  3529.               scwprintf("Record number = %ld\n",recno);
  3530.               scdclose(dbf);
  3531.             }
  3532.             scterm();
  3533.           }
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.           scdrundel
  3540.           scdrundel
  3541.           _________
  3542.  
  3543.  
  3544.  
  3545.  
  3546.           Usage
  3547.           Usage
  3548.           _____
  3549.                     signed short int scdrundel( signed char handle,
  3550.                                      scdrundel                     
  3551.                                                             ______ 
  3552.                                                 signed long int recno );
  3553.                                                                 _____   
  3554.  
  3555.  
  3556.           Prototype in
  3557.           Prototype in
  3558.           ____________
  3559.                     dbase.h
  3560.  
  3561.  
  3562.           Description
  3563.           Description
  3564.           ___________
  3565.                     scdrundel will  remove the 'deleted' flag from the data
  3566.                     scdrundel                                              
  3567.                     record specified by recno.
  3568.                                         _____ 
  3569.  
  3570.  
  3571.           See also
  3572.           See also
  3573.           ________
  3574.                     scdrdel.
  3575.                     scdrdel 
  3576.  
  3577.  
  3578.           Return Value
  3579.           Return Value
  3580.           ____________
  3581.                     SC_SUCCESS     record recovered
  3582.                     SC_BADHNDL     .DBF file not open or bad handle
  3583.                     SC_SKFAIL      invalid data record number or disk seek
  3584.                                    failure
  3585.                     SC_RDFAIL      disk read failure
  3586.                     SC_WRTFAIL     disk write failure
  3587.  
  3588.  
  3589.                                          Chapter 7, The SoftC Library    49
  3590.                                                                          49
  3591.  
  3592.  
  3593.           Example
  3594.           Example
  3595.           _______
  3596.  
  3597.           #include "SoftC.h"
  3598.           #include "dbase.h"
  3599.           #include "windows.h"
  3600.           
  3601.           void main()
  3602.           {
  3603.             char dbf;
  3604.             long recno;
  3605.           
  3606.             scinit(20,20);
  3607.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  3608.               scdrundel(dbf,1L);
  3609.               scdrget(dbf,1L);
  3610.               scwprintf("%s\n",scemsg());
  3611.               scdclose(dbf);
  3612.             }
  3613.             scterm();
  3614.           }
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.           scdsize
  3621.           scdsize
  3622.           _______
  3623.  
  3624.  
  3625.  
  3626.  
  3627.           Usage
  3628.           Usage
  3629.           _____
  3630.                     signed short int scdsize( signed char handle,
  3631.                                      scdsize                     
  3632.                                                           ______ 
  3633.                                               signed long int *recsused );
  3634.                                                                ________   
  3635.  
  3636.  
  3637.           Prototype in
  3638.           Prototype in
  3639.           ____________
  3640.                     dbase.h
  3641.  
  3642.  
  3643.           Description
  3644.           Description
  3645.           ___________
  3646.                     scdsize gets the number of records in the .DBF file.
  3647.                     scdsize                                             
  3648.  
  3649.  
  3650.           Return Value
  3651.           Return Value
  3652.           ____________
  3653.                     SC_SUCCESS     returned the number of records
  3654.                     SC_BADHNDL     .DBF file not open or bad handle
  3655.  
  3656.  
  3657.           Example
  3658.           Example
  3659.           _______
  3660.  
  3661.           #include "SoftC.h"
  3662.           #include "dbase.h"
  3663.           #include "windows.h"
  3664.           
  3665.  
  3666.  
  3667.           50    Chapter 7, The SoftC Library
  3668.           50                                
  3669.  
  3670.  
  3671.           void main()
  3672.           {
  3673.             char dbf;
  3674.             long recsused;
  3675.           
  3676.             scinit(20,20);
  3677.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  3678.               scdsize(dbf,&recsused);
  3679.               scwprintf("%ld",recsused);
  3680.               scdclose(dbf);
  3681.             }
  3682.             scterm();
  3683.           }
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.           sceclr
  3690.           sceclr
  3691.           ______
  3692.  
  3693.  
  3694.  
  3695.  
  3696.           Usage
  3697.           Usage
  3698.           _____
  3699.                     void sceclr( void );
  3700.                          sceclr         
  3701.  
  3702.  
  3703.           Prototype in
  3704.           Prototype in
  3705.           ____________
  3706.                     SoftC.h
  3707.  
  3708.  
  3709.           Description
  3710.           Description
  3711.           ___________
  3712.                     sceclr  will   clear  the   SoftC  library  error  flag
  3713.                     sceclr                                                 
  3714.                     (sc_code).
  3715.                      sc_code  
  3716.  
  3717.  
  3718.           See also
  3719.           See also
  3720.           ________
  3721.                     scemsg.
  3722.                     scemsg 
  3723.  
  3724.  
  3725.           Return Value
  3726.           Return Value
  3727.           ____________
  3728.                     None.
  3729.  
  3730.  
  3731.           Example
  3732.           Example
  3733.           _______
  3734.  
  3735.           #include "SoftC.h"
  3736.           #include "windows.h"
  3737.           
  3738.           void main()
  3739.           {
  3740.             scinit(20,20);
  3741.             sceclr();
  3742.  
  3743.  
  3744.                                          Chapter 7, The SoftC Library    51
  3745.                                                                          51
  3746.  
  3747.  
  3748.             scterm();
  3749.           }
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.           scemsg
  3756.           scemsg
  3757.           ______
  3758.  
  3759.  
  3760.  
  3761.  
  3762.           Usage
  3763.           Usage
  3764.           _____
  3765.                     signed char * scemsg( void );
  3766.                                   scemsg         
  3767.  
  3768.  
  3769.           Prototype in
  3770.           Prototype in
  3771.           ____________
  3772.                     SoftC.h
  3773.  
  3774.  
  3775.           Description
  3776.           Description
  3777.           ___________
  3778.                     scemsg gets  the  SoftC  library  error  message  which
  3779.                     scemsg                                                 
  3780.                     corresponds to the last known error.
  3781.  
  3782.  
  3783.                     Warning Codes and Messages:
  3784.  
  3785.  
  3786.                     1    "WARNING - record read is marked deleted",
  3787.                     2    "WARNING - file is empty",
  3788.                     3    "WARNING - no more keys",
  3789.                     4    "WARNING - could not find key in index file"
  3790.  
  3791.  
  3792.                     Error Codes and Messages:
  3793.  
  3794.  
  3795.                     -1   "ERROR - file write failure",
  3796.                     -2   "ERROR - file read failure",
  3797.                     -3   "ERROR - memory allocation error",
  3798.                     -4   "ERROR - bad user specified field description",
  3799.                     -5   "ERROR - file not in .DBF format",
  3800.                     -6   "ERROR - file pointer reposition failed",
  3801.                     -7   "ERROR - file not found",
  3802.                     -8   "ERROR - file corrupted",
  3803.                     -9   "ERROR - bad user specified key expression",
  3804.                     -10  "ERROR - file not in .NDX format",
  3805.                     -11  "ERROR - no handles available",
  3806.                     -12  "ERROR - no index pages loaded",
  3807.                     -13  "ERROR - index page was not loaded",
  3808.                     -14  "ERROR - file close failure",
  3809.                     -15  "ERROR - invalid command",
  3810.                     -16  "ERROR - invalid handle number",
  3811.                     -17  "ERROR - invalid filename",
  3812.  
  3813.  
  3814.           52    Chapter 7, The SoftC Library
  3815.           52                                
  3816.  
  3817.  
  3818.                     -18  "ERROR - invalid offset",
  3819.                     -19  "ERROR - bad window coordinates",
  3820.                     -20  "ERROR - window is overlaid by another",
  3821.                     -21  "ERROR - too many open windows",
  3822.                     -22  "ERROR - invalid date"
  3823.  
  3824.  
  3825.           See also
  3826.           See also
  3827.           ________
  3828.                     sceclr.
  3829.                     sceclr 
  3830.  
  3831.  
  3832.           Return Value
  3833.           Return Value
  3834.           ____________
  3835.                     scemsg returns the error message.
  3836.                     scemsg                           
  3837.  
  3838.  
  3839.           Example
  3840.           Example
  3841.           _______
  3842.  
  3843.           #include "SoftC.h"
  3844.           #include "windows.h"
  3845.           
  3846.           void main()
  3847.           {
  3848.             scinit(20,20);
  3849.             scwprintf("%s",scemsg());
  3850.             scterm();
  3851.           }
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.           sciclose
  3858.           sciclose
  3859.           ________
  3860.  
  3861.  
  3862.  
  3863.  
  3864.           Usage
  3865.           Usage
  3866.           _____
  3867.                     signed short int sciclose( signed char handle );
  3868.                                      sciclose                       
  3869.                                                            ______   
  3870.  
  3871.  
  3872.           Prototype in
  3873.           Prototype in
  3874.           ____________
  3875.                     dbase.h
  3876.  
  3877.  
  3878.           Description
  3879.           Description
  3880.           ___________
  3881.                     sciclose closes  an .NDX  file and  frees all allocated
  3882.                     sciclose                                               
  3883.                     memory associated with .NDX file.
  3884.  
  3885.  
  3886.           Return Value
  3887.           Return Value
  3888.           ____________
  3889.                     SC_SUCCESS     .NDX file closed
  3890.                     SC_CLOSFAIL    file close failure
  3891.                     SC_BADHNDL     .NDX file not open or bad handle
  3892.  
  3893.  
  3894.                                          Chapter 7, The SoftC Library    53
  3895.                                                                          53
  3896.  
  3897.  
  3898.           Example
  3899.           Example
  3900.           _______
  3901.  
  3902.           #include "SoftC.h"
  3903.           #include "dbase.h"
  3904.           
  3905.           void main()
  3906.           {
  3907.             char ndx;
  3908.           
  3909.             scinit(20,20);
  3910.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS)
  3911.               sciclose(ndx);
  3912.             scterm();
  3913.           }
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.           scicreate
  3920.           scicreate
  3921.           _________
  3922.  
  3923.  
  3924.  
  3925.  
  3926.           Usage
  3927.           Usage
  3928.           _____
  3929.                     signed short int scicreate( signed char *filename,
  3930.                                      scicreate                        
  3931.                                                              ________ 
  3932.                                                 signed char keytype,
  3933.                                                             _______ 
  3934.                                                 signed char *keyexpr,
  3935.                                                              _______ 
  3936.                                                 signed char keylen );
  3937.                                                             ______   
  3938.  
  3939.  
  3940.           Prototype in
  3941.           Prototype in
  3942.           ____________
  3943.                     dbase.h
  3944.  
  3945.  
  3946.           Description
  3947.           Description
  3948.           ___________
  3949.                     scicreate  creates   an  .NDX  file.  keyexpr  will  be
  3950.                     scicreate                                              
  3951.                                                           _______          
  3952.                     translated to  all upper  case when  the index  file is
  3953.                     created.
  3954.  
  3955.  
  3956.                     If keytype  is 'c',  then keyexpr  must be  a character
  3957.                        _______                _______                      
  3958.                     string consisting  of one  or more field names from the
  3959.                     data record. All fields included in the expression must
  3960.                     be of type 'c' or be translated into type 'c'. No check
  3961.                     is made to verify this. keylen cannot exceed 100.
  3962.                                             ______                   
  3963.  
  3964.  
  3965.                     If keytype  is 'n'  or 'd', then keyexpr should consist
  3966.                        _______                       _______               
  3967.                     of only  one data  field. keylen  will automatically be
  3968.                                               ______                       
  3969.                     set to 8 (numeric and date keys are stored as doubles).
  3970.  
  3971.  
  3972.           54    Chapter 7, The SoftC Library
  3973.           54                                
  3974.  
  3975.  
  3976.                     NOTE: scicreate will create a new .NDX file even if one
  3977.                           scicreate                                        
  3978.                     had already existed.
  3979.  
  3980.  
  3981.                     NOTE: keyexpr  is used  by  dBaseIII.  keyexpr  is  NOT
  3982.                           _______                          _______         
  3983.                     checked for  validity by  the SoftC  data file manager.
  3984.                     Currently only the scikmake function uses keyexpr.
  3985.                                        scikmake                       
  3986.                                                               _______ 
  3987.  
  3988.  
  3989.           See also
  3990.           See also
  3991.           ________
  3992.                     scikmake.
  3993.                     scikmake 
  3994.  
  3995.  
  3996.           Return Value
  3997.           Return Value
  3998.           ____________
  3999.                     SC_SUCCESS     .NDX file created
  4000.                     SC_WRTFAIL     disk write failure
  4001.                     SC_BADEXPR     invalid keytype or bad keyexpr
  4002.                     SC_NOHNDL      no DOS handles available
  4003.  
  4004.  
  4005.           Example
  4006.           Example
  4007.           _______
  4008.  
  4009.           #include "SoftC.h"
  4010.           #include "dbase.h"
  4011.           
  4012.           void main()
  4013.           {
  4014.             scinit(20,20);
  4015.             scicreate("TEST.NDX",'d',"date",8);
  4016.             scterm();
  4017.           }
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.           sciexpr
  4024.           sciexpr
  4025.           _______
  4026.  
  4027.  
  4028.  
  4029.  
  4030.           Usage
  4031.           Usage
  4032.           _____
  4033.                     signed short int sciexpr( signed char handle,
  4034.                                      sciexpr                     
  4035.                                                           ______ 
  4036.                                               signed char *keyexpr );
  4037.                                                            _______   
  4038.  
  4039.  
  4040.           Prototype in
  4041.           Prototype in
  4042.           ____________
  4043.                     dbase.h
  4044.  
  4045.  
  4046.           Description
  4047.           Description
  4048.           ___________
  4049.                     sciexpr gets the index key expression and returns it as
  4050.                     sciexpr                                                
  4051.                     a  character   string  into   a  user  supplied  buffer
  4052.                     (keyexpr). The  user must  ensure that  the  buffer  is
  4053.                      _______                                               
  4054.  
  4055.  
  4056.                                          Chapter 7, The SoftC Library    55
  4057.                                                                          55
  4058.  
  4059.  
  4060.                     large  enough   (the  key   expression  length  can  be
  4061.                     determined via  a call  to sciinfo)  to hold the entire
  4062.                                                sciinfo                     
  4063.                     key expression.
  4064.  
  4065.  
  4066.           See also
  4067.           See also
  4068.           ________
  4069.                     sciinfo.
  4070.                     sciinfo 
  4071.  
  4072.  
  4073.           Return Value
  4074.           Return Value
  4075.           ____________
  4076.                     SC_SUCCESS     returned the keyexpr
  4077.                     SC_BADHNDL     .NDX file not open or bad handle
  4078.  
  4079.  
  4080.           Example
  4081.           Example
  4082.           _______
  4083.  
  4084.           #include "SoftC.h"
  4085.           #include "dbase.h"
  4086.           #include "windows.h"
  4087.           
  4088.           void main()
  4089.           {
  4090.             char ndx, buffer[512];
  4091.           
  4092.             scinit(20,20);
  4093.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4094.               sciexpr(ndx,buffer);
  4095.               scwprintf("key expression = %s",buffer);
  4096.               sciclose(ndx);
  4097.             }
  4098.             scterm();
  4099.           }
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.           sciinfo
  4106.           sciinfo
  4107.           _______
  4108.  
  4109.  
  4110.  
  4111.  
  4112.           Usage
  4113.           Usage
  4114.           _____
  4115.                     signed short int sciinfo( signed char handle,
  4116.                                      sciinfo                     
  4117.                                                           ______ 
  4118.                                               signed char *filename,
  4119.                                                            ________ 
  4120.                                               signed char *keytype,
  4121.                                                            _______ 
  4122.                                               signed char *keylen,
  4123.                                                            ______ 
  4124.                                               signed short int *exprlen );
  4125.                                                                 _______   
  4126.  
  4127.  
  4128.           Prototype in
  4129.           Prototype in
  4130.           ____________
  4131.                     dbase.h
  4132.  
  4133.  
  4134.           56    Chapter 7, The SoftC Library
  4135.           56                                
  4136.  
  4137.  
  4138.           Description
  4139.           Description
  4140.           ___________
  4141.                     sciinfo gets  the filename  of the .NDX file associated
  4142.                     sciinfo                                                
  4143.                     with handle,  the index key type (keytype), the maximum
  4144.                          ______                       _______              
  4145.                     index key  length (keylen), and the length of the index
  4146.                                        ______                              
  4147.                     key expression (exprlen).
  4148.                                     _______  
  4149.  
  4150.  
  4151.           See also
  4152.           See also
  4153.           ________
  4154.                     sciopen.
  4155.                     sciopen 
  4156.  
  4157.  
  4158.           Return Value
  4159.           Return Value
  4160.           ____________
  4161.                     SC_SUCCESS     returned .NDX file information
  4162.                     SC_BADHNDL     .NDX file not open or bad handle
  4163.  
  4164.  
  4165.           Example
  4166.           Example
  4167.           _______
  4168.  
  4169.           #include <dir.h>
  4170.           #include "SoftC.h"
  4171.           #include "dbase.h"
  4172.           #include "windows.h"
  4173.           
  4174.           void main()
  4175.           {
  4176.             char ndx, filename[MAXPATH], keytype, keylen, exprlen;
  4177.           
  4178.             scinit(20,20);
  4179.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4180.               sciinfo(ndx,filename,&keytype,&keylen,&exprlen);
  4181.               scwprintf("File name = %s\n",filename);
  4182.               scwprintf("Index key type = %c\n",keytype);
  4183.               scwprintf("Maximum key length = %d\n",keylen);
  4184.               scwprintf("Key expression length = %d\n",exprlen);
  4185.               sciclose(ndx);
  4186.             }
  4187.             scterm();
  4188.           }
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.           scikadd
  4195.           scikadd
  4196.           _______
  4197.  
  4198.  
  4199.  
  4200.  
  4201.           Usage
  4202.           Usage
  4203.           _____
  4204.                     signed short int scikadd( signed char handle,
  4205.                                      scikadd                     
  4206.                                               signed char *key,
  4207.                                               signed long int recno );
  4208.  
  4209.  
  4210.                                          Chapter 7, The SoftC Library    57
  4211.                                                                          57
  4212.  
  4213.  
  4214.           Prototype in
  4215.           Prototype in
  4216.           ____________
  4217.                     dbase.h
  4218.  
  4219.  
  4220.           Description
  4221.           Description
  4222.           ___________
  4223.                     scikadd will  add key  to the  index file  specified by
  4224.                     scikadd                                                
  4225.                                       ___                                  
  4226.                     handle.  recno   is  the   data  record  number  to  be
  4227.                              _____                                         
  4228.                     associated with  key (the  data record  pointed  to  by
  4229.                                      ___                                   
  4230.                     recno must exist prior to calling scikadd).
  4231.                                                       scikadd  
  4232.  
  4233.  
  4234.           Return Value
  4235.           Return Value
  4236.           ____________
  4237.                     SC_SUCCESS     key added to .NDX file
  4238.                     SC_BADHNDL     .NDX file not open or bad handle
  4239.                     SC_SKFAIL      disk seek failure
  4240.                     SC_WRTFAIL     disk write failure
  4241.                     SC_RDFAIL      disk read failure
  4242.                     SC_MEMERR      memory allocation failure
  4243.  
  4244.  
  4245.           Example
  4246.           Example
  4247.           _______
  4248.  
  4249.           #include <string.h>
  4250.           #include "SoftC.h"
  4251.           #include "dbase.h"
  4252.           
  4253.           void main()
  4254.           {
  4255.             char dbf, ndx, date[9];
  4256.             short result;
  4257.             long recno;
  4258.           
  4259.             scinit(20,20);
  4260.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  4261.               if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4262.                 strcpy(date,"19881201");
  4263.                 scdfputs(dbf,1,date);
  4264.                 result = scdrput(dbf,SC_ADD,&recno)
  4265.                 if (result == SC_SUCCESS)
  4266.                   scikadd(ndx,date,recno);
  4267.                 sciclose(ndx);
  4268.               }
  4269.               scdclose(dbf)
  4270.             }
  4271.             scterm();
  4272.           }
  4273.  
  4274.  
  4275.           58    Chapter 7, The SoftC Library
  4276.           58                                
  4277.  
  4278.  
  4279.           scikcur
  4280.           scikcur
  4281.           _______
  4282.  
  4283.  
  4284.  
  4285.  
  4286.           Usage
  4287.           Usage
  4288.           _____
  4289.                     signed short int scikcur( signed char handle,
  4290.                                      scikcur                     
  4291.                                                           ______ 
  4292.                                               signed char *key,
  4293.                                                            ___ 
  4294.                                               signed long int *recno );
  4295.                                                                _____   
  4296.  
  4297.  
  4298.           Prototype in
  4299.           Prototype in
  4300.           ____________
  4301.                     dbase.h
  4302.  
  4303.  
  4304.           Description
  4305.           Description
  4306.           ___________
  4307.                     scikcur will return the key value (key) and data record
  4308.                     scikcur                                                
  4309.                                                        ___                 
  4310.                     number (recno)  associated with  the current key in the
  4311.                             _____                                          
  4312.                     index file.
  4313.  
  4314.  
  4315.                     The current key pointer must be set by a call to either
  4316.                     scikfind,  scikfirst,   or  sciklast   before   calling
  4317.                     scikfind   scikfirst        sciklast                   
  4318.                     scikcur.
  4319.                     scikcur 
  4320.  
  4321.  
  4322.                     The user must ensure that the buffer used to return the
  4323.                     key is  long enough to hold the entire key. The maximum
  4324.                     length of  the key  can be  determined via  a  call  to
  4325.                     sciinfo.
  4326.                     sciinfo 
  4327.  
  4328.  
  4329.           See also
  4330.           See also
  4331.           ________
  4332.                     sciinfo, scikfind, scikfirst, and sciklast.
  4333.                     sciinfo  scikfind  scikfirst      sciklast 
  4334.  
  4335.  
  4336.           Return Value
  4337.           Return Value
  4338.           ____________
  4339.                     SC_SUCCESS     key and recno returned
  4340.                     SC_BADHNDL     .NDX file not open or bad handle
  4341.                     SC_END         no current key - no call to scikfind,
  4342.                                                                scikfind 
  4343.                                    scikfirst, or sciklast had been made to
  4344.                                    scikfirst     sciklast                 
  4345.                                    initialize index pointers.
  4346.                     SC_RDFAIL      read index file failure
  4347.                     SC_SKFAIL      seek failure (bad record address or seek
  4348.                                    fail)
  4349.  
  4350.  
  4351.           Example
  4352.           Example
  4353.           _______
  4354.  
  4355.           #include "SoftC.h"
  4356.           #include "dbase.h"
  4357.           #include "windows.h"
  4358.           
  4359.           void main()
  4360.  
  4361.  
  4362.                                          Chapter 7, The SoftC Library    59
  4363.                                                                          59
  4364.  
  4365.  
  4366.           {
  4367.             char ndx, date[9], dat[9];
  4368.             long recno, rnum;
  4369.           
  4370.             scinit(20,20);
  4371.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4372.               date[8] = 0;
  4373.               dat[8] = 0;
  4374.               scikfirst(ndx,date,&recno);
  4375.               scikcur(ndx,dat,&rnum);
  4376.               scwprintf("%s %s %ld %ld\n",
  4377.                 date,dat,recno,rnum);
  4378.               sciclose(ndx);
  4379.             }
  4380.             scterm();
  4381.           }
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.           scikdel
  4388.           scikdel
  4389.           _______
  4390.  
  4391.  
  4392.  
  4393.  
  4394.           Usage
  4395.           Usage
  4396.           _____
  4397.                     signed short int scikdel( signed char handle,
  4398.                                      scikdel                     
  4399.                                                           ______ 
  4400.                                               signed char *key,
  4401.                                                            ___ 
  4402.                                               signed long int recno );
  4403.                                                               _____   
  4404.  
  4405.  
  4406.           Prototype in
  4407.           Prototype in
  4408.           ____________
  4409.                     dbase.h
  4410.  
  4411.  
  4412.           Description
  4413.           Description
  4414.           ___________
  4415.                     scikdel will  remove key  from the index file specified
  4416.                     scikdel                                                
  4417.                                          ___                               
  4418.                     by handle.  recno is used along with key to ensure that
  4419.                        ______   _____                                      
  4420.                     the proper key has been removed from the .NDX file.
  4421.  
  4422.  
  4423.           Return Value
  4424.           Return Value
  4425.           ____________
  4426.                     SC_SUCCESS     key removed from .NDX file
  4427.                     SC_BADHNDL     .NDX file not open or bad handle
  4428.                     SC_SKFAIL      disk seek failure
  4429.                     SC_WRTFAIL     disk write failure
  4430.                     SC_RDFAIL      index file read failure
  4431.                     SC_EMPTY       index file is empty - no keys found
  4432.                     SC_NOFIND      desired key was not found
  4433.  
  4434.  
  4435.           60    Chapter 7, The SoftC Library
  4436.           60                                
  4437.  
  4438.  
  4439.           Example
  4440.           Example
  4441.           _______
  4442.  
  4443.           #include <string.h>
  4444.           #include "SoftC.h"
  4445.           #include "dbase.h"
  4446.           
  4447.           void main()
  4448.           {
  4449.             char ndx, date[9];
  4450.             long recno;
  4451.           
  4452.             scinit(20,20);
  4453.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4454.               strcpy(date,"19881202");
  4455.               recno = 7L;
  4456.               scikdel(ndx,date,recno);
  4457.               sciclose(ndx);
  4458.             }
  4459.             scterm();
  4460.           }
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.           scikfind
  4467.           scikfind
  4468.           ________
  4469.  
  4470.  
  4471.  
  4472.  
  4473.           Usage
  4474.           Usage
  4475.           _____
  4476.                     signed short int scikfind( signed char handle,
  4477.                                      scikfind                     
  4478.                                                            ______ 
  4479.                                                signed char method,
  4480.                                                            ______ 
  4481.                                                signed char *key,
  4482.                                                             ___ 
  4483.                                                signed long int *recno );
  4484.                                                                 _____   
  4485.  
  4486.  
  4487.           Prototype in
  4488.           Prototype in
  4489.           ____________
  4490.                     dbase.h
  4491.  
  4492.  
  4493.           Description
  4494.           Description
  4495.           ___________
  4496.                     need to explain the two methods of key searching.
  4497.  
  4498.  
  4499.                     scikfind searches  through the  .NDX file looking for a
  4500.                     scikfind                                               
  4501.                     key and data record number match with key and recno. If
  4502.                                                           ___     _____    
  4503.                     an exact match cannot be found, the current key will be
  4504.                     the physical  key which  would immediately precede key.
  4505.                                                                        ___ 
  4506.                     The current  key's value and data record number will be
  4507.                     returned in key and recno.
  4508.                                 ___     _____ 
  4509.  
  4510.  
  4511.                                          Chapter 7, The SoftC Library    61
  4512.                                                                          61
  4513.  
  4514.  
  4515.                     The user must ensure that the buffer used to return the
  4516.                     key is  long enough to hold the entire key. The maximum
  4517.                     length of  the key  can be  determined via  a  call  to
  4518.                     sciinfo.
  4519.                     sciinfo 
  4520.  
  4521.  
  4522.           See also
  4523.           See also
  4524.           ________
  4525.                     sciinfo.
  4526.                     sciinfo 
  4527.  
  4528.  
  4529.           Return Value
  4530.           Return Value
  4531.           ____________
  4532.                     SC_SUCCESS     key found
  4533.                     SC_NOFIND      key not found
  4534.                     SC_EMPTY       .NDX file empty - no keys found
  4535.                     SC_BADHNDL     .NDX file not open or bad handle
  4536.                     SC_SKFAIL      seek failure (bad record address or seek
  4537.                                    fail)
  4538.                     SC_RDFAIL      read index file failure
  4539.                     SC_END         end of index file
  4540.  
  4541.  
  4542.           Example
  4543.           Example
  4544.           _______
  4545.  
  4546.           #include <string.h>
  4547.           #include "SoftC.h"
  4548.           #include "dbase.h"
  4549.           #include "windows.h"
  4550.           void main()
  4551.           {
  4552.             char ndx, key[100];
  4553.             long recno;
  4554.             int result;
  4555.           
  4556.             scinit(20,20);
  4557.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4558.               strcpy(date,"19881202");
  4559.               recno = 7L;
  4560.               scikfind(ndx,SC_EXACT,date,&recno);
  4561.               scwprintf("%s\n",scemsg());
  4562.               scdclose(ndx);
  4563.             }
  4564.             scterm();
  4565.           }
  4566.  
  4567.  
  4568.           62    Chapter 7, The SoftC Library
  4569.           62                                
  4570.  
  4571.  
  4572.           scikfirst
  4573.           scikfirst
  4574.           _________
  4575.  
  4576.  
  4577.  
  4578.  
  4579.           Usage
  4580.           Usage
  4581.           _____
  4582.                     signed short int scikfirst( signed char handle,
  4583.                                      scikfirst                     
  4584.                                                             ______ 
  4585.                                                 signed char *key,
  4586.                                                              ___ 
  4587.                                                 signed long int *recno );
  4588.                                                                  _____   
  4589.  
  4590.  
  4591.           Prototype in
  4592.           Prototype in
  4593.           ____________
  4594.                     dbase.h
  4595.  
  4596.  
  4597.           Description
  4598.           Description
  4599.           ___________
  4600.                     scikfirst will set the current key pointer to the first
  4601.                     scikfirst                                              
  4602.                     logical key  in the .NDX and return the key value (key)
  4603.                                                                        ___ 
  4604.                     and data  record number (recno) associated with the new
  4605.                                              _____                         
  4606.                     current key.
  4607.  
  4608.  
  4609.                     The user must ensure that the buffer used to return the
  4610.                     key is  long enough to hold the entire key. The maximum
  4611.                     length of  the key  can be  determined via  a  call  to
  4612.                     sciinfo.
  4613.                     sciinfo 
  4614.  
  4615.  
  4616.           See also
  4617.           See also
  4618.           ________
  4619.                     sciinfo
  4620.                     sciinfo
  4621.  
  4622.  
  4623.           Return Value
  4624.           Return Value
  4625.           ____________
  4626.                     SC_SUCCESS     key and recno returned
  4627.                     SC_BADHNDL     .NDX file not open or bad handle
  4628.                     SC_EMPTY       .NDX file empty - no keys found
  4629.                     SC_SKFAIL      seek failure
  4630.                     SC_RDFAIL      read index file failure
  4631.  
  4632.  
  4633.           Example
  4634.           Example
  4635.           _______
  4636.  
  4637.           #include "SoftC.h"
  4638.           #include "dbase.h"
  4639.           #include "windows.h"
  4640.           
  4641.           void main()
  4642.           {
  4643.             char ndx, date[9];
  4644.             long recno;
  4645.           
  4646.             scinit(20,20);
  4647.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4648.               date[8] = 0;
  4649.  
  4650.  
  4651.                                          Chapter 7, The SoftC Library    63
  4652.                                                                          63
  4653.  
  4654.  
  4655.               scikfirst(ndx,date,&recno);
  4656.               scwprintf("%d %ld\n",date,recno);
  4657.               sciclose(ndx);
  4658.             }
  4659.             scterm();
  4660.           }
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.           sciklast
  4667.           sciklast
  4668.           ________
  4669.  
  4670.  
  4671.  
  4672.  
  4673.           Usage
  4674.           Usage
  4675.           _____
  4676.                     signed short int sciklast( signed char handle,
  4677.                                      sciklast                     
  4678.                                                            ______ 
  4679.                                                signed char *key,
  4680.                                                             ___ 
  4681.                                                signed long int *recno );
  4682.                                                                 _____   
  4683.  
  4684.  
  4685.           Prototype in
  4686.           Prototype in
  4687.           ____________
  4688.                     dbase.h
  4689.  
  4690.  
  4691.           Description
  4692.           Description
  4693.           ___________
  4694.                     sciklast will  set the  current key pointer to the last
  4695.                     sciklast                                               
  4696.                     logical key  in the .NDX and return the key value (key)
  4697.                                                                        ___ 
  4698.                     and data  record number (recno) associated with the new
  4699.                                              _____                         
  4700.                     current key.
  4701.  
  4702.  
  4703.                     The user must ensure that the buffer used to return the
  4704.                     key is  long enough to hold the entire key. The maximum
  4705.                     length of  the key  can be  determined via  a  call  to
  4706.                     sciinfo.
  4707.                     sciinfo 
  4708.  
  4709.  
  4710.           See also
  4711.           See also
  4712.           ________
  4713.                     sciinfo.
  4714.                     sciinfo 
  4715.  
  4716.  
  4717.           Return Value
  4718.           Return Value
  4719.           ____________
  4720.                     SC_SUCCESS     key and recno returned
  4721.                     SC_BADHNDL     .NDX file not open or bad handle
  4722.                     SC_EMPTY       .NDX file empty - no keys found
  4723.                     SC_SKFAIL      seek failure
  4724.                     SC_RDFAIL      read from index file failure
  4725.  
  4726.  
  4727.           64    Chapter 7, The SoftC Library
  4728.           64                                
  4729.  
  4730.  
  4731.           Example
  4732.           Example
  4733.           _______
  4734.  
  4735.           #include "SoftC.h"
  4736.           #include "dbase.h"
  4737.           #include "windows.h"
  4738.           
  4739.           void main()
  4740.           {
  4741.             char ndx, date[9];
  4742.             long recno;
  4743.           
  4744.             scinit(20,20);
  4745.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4746.               date[8] = 0;
  4747.               sciklast(ndx,date,&recno);
  4748.               scwprintf("%s %ld\n",date,recno);
  4749.               sciclose(ndx);
  4750.             }
  4751.             scterm();
  4752.           }
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.           scikmake
  4759.           scikmake
  4760.           ________
  4761.  
  4762.  
  4763.  
  4764.  
  4765.           Usage
  4766.           Usage
  4767.           _____
  4768.                     signed short int scikmake( signed char datahandle,
  4769.                                      scikmake                         
  4770.                                                            __________ 
  4771.                                                signed char indexhandle,
  4772.                                                            ___________ 
  4773.                                                void ** key );
  4774.                                                        ___   
  4775.  
  4776.  
  4777.           Prototype in
  4778.           Prototype in
  4779.           ____________
  4780.                     dbase.h
  4781.  
  4782.  
  4783.           Description
  4784.           Description
  4785.           ___________
  4786.                     scikmake  will   build  an  index  key  using  the  key
  4787.                     scikmake                                               
  4788.                     expression of  the index  file specified by indexhandle
  4789.                                                                 ___________
  4790.                     and the  data found  in the  output buffer  of the data
  4791.                     file of  datahandle. Memory  space for  the key will be
  4792.                              __________                         ___        
  4793.                     allocated  and  the  address  of  this  block  will  be
  4794.                     returned.
  4795.  
  4796.  
  4797.                     The key expression can consist of either the data field
  4798.                     name or one of five dBaseIII functions or a combination
  4799.                     thereof.  Data   field  types   of  date,  numeric,  or
  4800.                     character are  allowed. dBaseIII  functions dtoc, left,
  4801.                                                                 dtoc  left 
  4802.  
  4803.  
  4804.                                          Chapter 7, The SoftC Library    65
  4805.                                                                          65
  4806.  
  4807.  
  4808.                     right,  str,   and  substr  are  current  supported  by
  4809.                     right   str         substr                             
  4810.                     scikmake.
  4811.                     scikmake 
  4812.  
  4813.  
  4814.                     dBaseIII supports only two types of keys: character and
  4815.                     numeric. The  only numeric  keys supported by SoftC are
  4816.                     just the date and numeric data field names.
  4817.  
  4818.  
  4819.                     dtoc will convert data from a date field to a character
  4820.                     dtoc                                                   
  4821.                     string   of    the   format    mm/dd/yy.   Syntax    is
  4822.                     dtoc(field_name).
  4823.  
  4824.  
  4825.                     left will  return the left portion of a character field
  4826.                     left                                                   
  4827.                     as a  string. The  number  of  characters  returned  is
  4828.                     specified   after    the   field    name.   Syntax   is
  4829.                     left(field_name,number).
  4830.  
  4831.  
  4832.                     right will  return the  right portion  of  a  character
  4833.                     right                                                  
  4834.                     field as a string. The number of characters returned is
  4835.                     specified after  the field  name. This  is a count from
  4836.                     the   right    side   of    the   field.    Syntax   is
  4837.                     right(field_name,count).
  4838.  
  4839.  
  4840.                     str will  convert a  numeric field  to an ascii string.
  4841.                     str                                                    
  4842.                     The total  length of  the  string  and  the  number  of
  4843.                     decimal places  are optional  parameters.  The  default
  4844.                     string length is 10 and the number of decimal places is
  4845.                     0. Syntax is str(field_name,length,decimal_places).
  4846.  
  4847.  
  4848.                     substr will  return the  middle portion  of a character
  4849.                     substr                                                 
  4850.                     field. The starting offset into the field is a required
  4851.                     parameter. The  number of  characters to  be used is an
  4852.                     optional parameter whose default value is the remainder
  4853.                     of the field. Syntax is substr(field_name,start,count).
  4854.  
  4855.  
  4856.                     An example of a more complex key expression:
  4857.  
  4858.  
  4859.                     right(dtoc(date),2)+left(dtoc(date,2)
  4860.  
  4861.  
  4862.                     This expression would cause scikmake to create an index
  4863.                                                 scikmake                   
  4864.                     key string  consisting of  the year and month ("yymm").
  4865.                     For example  if date equals "2/13/89" the resultant key
  4866.                     would be "8902".
  4867.  
  4868.  
  4869.           66    Chapter 7, The SoftC Library
  4870.           66                                
  4871.  
  4872.  
  4873.                     Note that  for key  expressions consisting  of only one
  4874.                     data field  scikmake is  probably an  overkill. You can
  4875.                                 scikmake                                   
  4876.                     easily generate  these keys  yourself.  scikmake  is  a
  4877.                                                             scikmake       
  4878.                     fairly large  module and  if not needed probably should
  4879.                     not be  used. This  function is  best used when the key
  4880.                     expression is more complex.
  4881.  
  4882.  
  4883.           See also
  4884.           See also
  4885.           ________
  4886.                     scicreate.
  4887.                     scicreate 
  4888.  
  4889.  
  4890.           Return Value
  4891.           Return Value
  4892.           ____________
  4893.                     SC_SUCCESS     key and recno returned
  4894.                     SC_BADHNDL     .NDX file not open or bad handle
  4895.                     SC_MEMERR      memory allocation failure
  4896.                     SC_BADEXPR     invalid key expression
  4897.  
  4898.  
  4899.           Example
  4900.           Example
  4901.           _______
  4902.  
  4903.           #include "SoftC.h"
  4904.           #include "dbase.h"
  4905.           #include "windows.h"
  4906.           
  4907.           void main()
  4908.           {
  4909.             char ndx, dbf, char *key, date[9];
  4910.             long recno;
  4911.           
  4912.             scinit(20,20);
  4913.             if (scdopen(&dbf,"TEST.DBF") == SC_SUCCESS) {
  4914.               if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  4915.                 scdfput(dbf,0,&date);
  4916.                 scdrput(dbf,SC_ADD,&recno);
  4917.                 scikmake(dbf,ndx,(void **) &key);
  4918.                 scikadd(ndx,key,recno);
  4919.                 free(key);
  4920.                 sciclose(ndx);
  4921.               }
  4922.               scdclose(dbf);
  4923.             }
  4924.             scterm();
  4925.           }
  4926.  
  4927.  
  4928.                                          Chapter 7, The SoftC Library    67
  4929.                                                                          67
  4930.  
  4931.  
  4932.           sciknext
  4933.           sciknext
  4934.           ________
  4935.  
  4936.  
  4937.  
  4938.  
  4939.           Usage
  4940.           Usage
  4941.           _____
  4942.                     signed short int sciknext( signed char handle,
  4943.                                      sciknext                     
  4944.                                                            ______ 
  4945.                                                signed char *key,
  4946.                                                             ___ 
  4947.                                                signed long int *recno );
  4948.                                                                 _____   
  4949.  
  4950.  
  4951.           Prototype in
  4952.           Prototype in
  4953.           ____________
  4954.                     dbase.h
  4955.  
  4956.  
  4957.           Description
  4958.           Description
  4959.           ___________
  4960.                     sciknext will  increment the key pointer and return the
  4961.                     sciknext                                               
  4962.                     key  value   (key)  and   data  record  number  (recno)
  4963.                                   ___                                _____ 
  4964.                     associated with the new current key.
  4965.  
  4966.  
  4967.                     The current key pointer must be set by a call to either
  4968.                     scikfind,  scikfirst,   or  sciklast   before   calling
  4969.                     scikfind   scikfirst        sciklast                   
  4970.                     sciknext.
  4971.                     sciknext 
  4972.  
  4973.  
  4974.                     The user must ensure that the buffer used to return the
  4975.                     key is  long enough to hold the entire key. The maximum
  4976.                     length of  the key  can be  determined via  a  call  to
  4977.                     sciinfo.
  4978.                     sciinfo 
  4979.  
  4980.  
  4981.           See also
  4982.           See also
  4983.           ________
  4984.                     sciinfo, scikfind, scikfirst, and sciklast.
  4985.                     sciinfo  scikfind  scikfirst      sciklast 
  4986.  
  4987.  
  4988.           Return Value
  4989.           Return Value
  4990.           ____________
  4991.                     SC_SUCCESS     key and recno returned
  4992.                     SC_BADHNDL     .NDX file not open or bad handle
  4993.                     SC_END         no more keys - at end of .NDX file
  4994.                     SC_RDFAIL      index file read failure
  4995.                     SC_SKFAIL      seek failure (bad record address or seek
  4996.                                    failed)
  4997.  
  4998.  
  4999.           Example
  5000.           Example
  5001.           _______
  5002.  
  5003.           #include "SoftC.h"
  5004.           #include "dbase.h"
  5005.           #include "windows.h"
  5006.           
  5007.           void main()
  5008.           {
  5009.             char ndx, date[9];
  5010.  
  5011.  
  5012.           68    Chapter 7, The SoftC Library
  5013.           68                                
  5014.  
  5015.  
  5016.             long recno;
  5017.           
  5018.             scinit(20,20);
  5019.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  5020.               scikfirst(ndx,date,&recno);
  5021.               sciknext(ndx,date,&recno);
  5022.               scwprintf("%s %ld\n",date,recno);
  5023.               sciclose(ndx);
  5024.             }
  5025.             scterm();
  5026.           }
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.           scikprev
  5033.           scikprev
  5034.           ________
  5035.  
  5036.  
  5037.  
  5038.  
  5039.           Usage
  5040.           Usage
  5041.           _____
  5042.                     signed short int scikprev( signed char handle,
  5043.                                      scikprev                     
  5044.                                                            ______ 
  5045.                                                signed char *key,
  5046.                                                             ___ 
  5047.                                                signed long int *recno );
  5048.                                                                 _____   
  5049.  
  5050.  
  5051.           Prototype in
  5052.           Prototype in
  5053.           ____________
  5054.                     dbase.h
  5055.  
  5056.  
  5057.           Description
  5058.           Description
  5059.           ___________
  5060.                     scikprev will  decrement the key pointer and return the
  5061.                     scikprev                                               
  5062.                     key  value   (key)  and   data  record  number  (recno)
  5063.                                   ___                                _____ 
  5064.                     associated with the new current key.
  5065.  
  5066.  
  5067.                     The current key pointer must be set by a call to either
  5068.                     scikfind,  scikfirst,   or  sciklast   before   calling
  5069.                     scikfind   scikfirst        sciklast                   
  5070.                     scikprev.
  5071.                     scikprev 
  5072.  
  5073.  
  5074.                     The user must ensure that the buffer used to return the
  5075.                     key is  long enough to hold the entire key. The maximum
  5076.                     length of  the key  can be  determined via  a  call  to
  5077.                     sciinfo.
  5078.                     sciinfo 
  5079.  
  5080.  
  5081.           See also
  5082.           See also
  5083.           ________
  5084.                     sciinfo, scikfind, scikfirst, and sciklast.
  5085.                     sciinfo  scikfind  scikfirst      sciklast 
  5086.  
  5087.  
  5088.           Return Value
  5089.           Return Value
  5090.           ____________
  5091.                     SC_SUCCESS     key and recno returned
  5092.  
  5093.  
  5094.                                          Chapter 7, The SoftC Library    69
  5095.                                                                          69
  5096.  
  5097.  
  5098.                     SC_BADHNDL     .NDX file not open or bad handle
  5099.                     SC_END         no more keys - at end of .NDX file
  5100.                     SC_RDFAIL      index file read failure
  5101.                     SC_SKFAIL      index file record seek failure
  5102.  
  5103.  
  5104.           Example
  5105.           Example
  5106.           _______
  5107.  
  5108.           #include "SoftC.h"
  5109.           #include "dbase.h"
  5110.           #include "windows.h"
  5111.           
  5112.           void main()
  5113.           {
  5114.             char ndx, date[9];
  5115.             long recno;
  5116.           
  5117.             scinit(20,20);
  5118.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  5119.               sciklast(ndx,date,&recno);
  5120.               scikprev(ndx,date,&recno);
  5121.               scwprintf("%s %ld\n",date,recno);
  5122.               sciclose(ndx);
  5123.             }
  5124.             scterm();
  5125.           }
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.           scinit
  5132.           scinit
  5133.           ______
  5134.  
  5135.  
  5136.  
  5137.  
  5138.           Usage
  5139.           Usage
  5140.           _____
  5141.                     signed short int scinit( signed char files,
  5142.                                      scinit                    
  5143.                                                          _____ 
  5144.                                              signed char windows );
  5145.                                                          _______   
  5146.  
  5147.  
  5148.           Prototype in
  5149.           Prototype in
  5150.           ____________
  5151.                     SoftC.h
  5152.  
  5153.  
  5154.           Description
  5155.           Description
  5156.           ___________
  5157.                     scinit is called once and only once at the beginning of
  5158.                     scinit                                                 
  5159.                     the program. The maximum numbers of simultaneously open
  5160.                     files and windows are passed. This function sets up the
  5161.                     _____     _______                                      
  5162.                     SoftC  environment   for  processing.  Memory  will  be
  5163.                     allocated for  a variety  of  control  structures  used
  5164.                     internally by the SoftC manager.
  5165.  
  5166.  
  5167.           70    Chapter 7, The SoftC Library
  5168.           70                                
  5169.  
  5170.  
  5171.           See also
  5172.           See also
  5173.           ________
  5174.                     scterm.
  5175.                     scterm 
  5176.  
  5177.  
  5178.           Return Value
  5179.           Return Value
  5180.           ____________
  5181.                     SC_SUCCESS     completed initialization
  5182.                     SC_MEMERR      memory allocation failure
  5183.                     SC_BADHNDL     invalid number of handles
  5184.  
  5185.  
  5186.           Example
  5187.           Example
  5188.           _______
  5189.  
  5190.           #include "SoftC.h"
  5191.           
  5192.           void main()
  5193.           {
  5194.             scinit(20,20);
  5195.             scterm();
  5196.           }
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.           sciopen
  5203.           sciopen
  5204.           _______
  5205.  
  5206.  
  5207.  
  5208.  
  5209.           Usage
  5210.           Usage
  5211.           _____
  5212.                     signed short int sciopen( signed char *handle,
  5213.                                      sciopen                      
  5214.                                                            ______ 
  5215.                                               signed char *filename );
  5216.                                                            ________   
  5217.  
  5218.  
  5219.           Prototype in
  5220.           Prototype in
  5221.           ____________
  5222.                     dbase.h
  5223.  
  5224.  
  5225.           Description
  5226.           Description
  5227.           ___________
  5228.                     sciopen opens  an .NDX  file. Memory  will be allocated
  5229.                     sciopen                                                
  5230.                     for a file packet, I/O buffers, and other miscellaneous
  5231.                     structures  for   use  internally  by  the  SoftC  file
  5232.                     manager.
  5233.  
  5234.  
  5235.           Return Value
  5236.           Return Value
  5237.           ____________
  5238.                     SC_SUCCESS     .NDX file opened
  5239.                     SC_MEMERR      memory allocation failure
  5240.                     SC_NOFILE      .NDX file not found
  5241.                     SC_RDFAIL      disk read failure
  5242.                     SC_NONDX       file not in .NDX format
  5243.                     SC_SKFAIL      disk seek failure
  5244.                     SC_NOHNDL      no SoftC handles available
  5245.                     SC_BADFNAME    invalid filename
  5246.  
  5247.  
  5248.                                          Chapter 7, The SoftC Library    71
  5249.                                                                          71
  5250.  
  5251.  
  5252.           Example
  5253.           Example
  5254.           _______
  5255.  
  5256.           #include "SoftC.h"
  5257.           #include "dbase.h"
  5258.           
  5259.           void main()
  5260.           {
  5261.             char ndx;
  5262.           
  5263.             scinit(20,20);
  5264.             if (sciopen(&ndx,"UNKNOWN.NDX") == SC_SUCCESS) {
  5265.               sciclose(ndx);
  5266.             }
  5267.             scterm();
  5268.           }
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.           scipinfo
  5275.           scipinfo
  5276.           ________
  5277.  
  5278.  
  5279.  
  5280.  
  5281.           Usage
  5282.           Usage
  5283.           _____
  5284.                     signed short int scipinfo( signed char handle,
  5285.                                      scipinfo                     
  5286.                                                            ______ 
  5287.                                                signed char *numpgs );
  5288.  
  5289.  
  5290.           Prototype in
  5291.           Prototype in
  5292.           ____________
  5293.                     dbase.h
  5294.  
  5295.  
  5296.           Description
  5297.           Description
  5298.           ___________
  5299.                     scipinfo gets  the maximum  number of  index pages  the
  5300.                     scipinfo                                               
  5301.                     SoftC file  manager can  keep in  memory and returns it
  5302.                     via numpgs.
  5303.  
  5304.  
  5305.           Return Value
  5306.           Return Value
  5307.           ____________
  5308.                     SC_SUCCESS     max number of pages allowed returned
  5309.                     SC_BADHNDL     .NDX file not open or bad handle
  5310.  
  5311.  
  5312.           Example
  5313.           Example
  5314.           _______
  5315.  
  5316.           #include "SoftC.h"
  5317.           #include "dbase.h"
  5318.           #include "windows.h"
  5319.           
  5320.           void main()
  5321.           {
  5322.             char ndx, numpgs;
  5323.  
  5324.  
  5325.           72    Chapter 7, The SoftC Library
  5326.           72                                
  5327.  
  5328.  
  5329.           
  5330.             scinit(20,20);
  5331.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  5332.               scipinfo(ndx,&numpgs) == SC_SUCCESS)
  5333.               scwprintf("Maximum number of pages = %d\n",numpgs);
  5334.               sciclose(ndx);
  5335.             }
  5336.             scterm();
  5337.           }
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.           scipnum
  5344.           scipnum
  5345.           _______
  5346.  
  5347.  
  5348.  
  5349.  
  5350.           Usage
  5351.           Usage
  5352.           _____
  5353.                     signed short int scipnum( signed char handle,
  5354.                                      scipnum                     
  5355.                                                           ______ 
  5356.                                               signed char *numpgs );
  5357.                                                            ______   
  5358.  
  5359.  
  5360.           Prototype in
  5361.           Prototype in
  5362.           ____________
  5363.                     dbase.h
  5364.  
  5365.  
  5366.           Description
  5367.           Description
  5368.           ___________
  5369.                     scipnum sets the maximum number of index pages (numpgs)
  5370.                     scipnum                                                
  5371.                                                                     ______ 
  5372.                     the SoftC  file manager  can keep in memory. Memory for
  5373.                     index pages will be freed or allocated as appropriate.
  5374.  
  5375.  
  5376.           Return Value
  5377.           Return Value
  5378.           ____________
  5379.                     SC_SUCCESS     new max number of pages allowed returned
  5380.                     SC_BADHNDL     .NDX file was open or bad handle
  5381.                     SC_BADCMD      invalid new number of pages requested
  5382.  
  5383.  
  5384.           Example
  5385.           Example
  5386.           _______
  5387.  
  5388.           #include "SoftC.h"
  5389.           #include "dbase.h"
  5390.           #include "windows.h"
  5391.           
  5392.           void main()
  5393.           {
  5394.             char ndx, numpgs = 5;
  5395.           
  5396.             scinit(20,20);
  5397.             if (sciopen(&ndx,"TEST.NDX") == SC_SUCCESS) {
  5398.               scipnum(ndx,&numpgs);
  5399.               scipinfo(ndx,&numpgs);
  5400.  
  5401.  
  5402.                                          Chapter 7, The SoftC Library    73
  5403.                                                                          73
  5404.  
  5405.  
  5406.               scwprintf("New max = %d\n",numpgs);
  5407.               sciclose(ndx);
  5408.             }
  5409.             scterm();
  5410.           }
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.           scterm
  5417.           scterm
  5418.           ______
  5419.  
  5420.  
  5421.  
  5422.  
  5423.           Usage
  5424.           Usage
  5425.           _____
  5426.                     void scterm( void );
  5427.                          scterm         
  5428.  
  5429.  
  5430.           Prototype in
  5431.           Prototype in
  5432.           ____________
  5433.                     SoftC.h
  5434.  
  5435.  
  5436.           Description
  5437.           Description
  5438.           ___________
  5439.                     scterm is called once at the end of the program. Memory
  5440.                     scterm                                                 
  5441.                     allocated by  scinit for  internal  control  structures
  5442.                                   scinit                                   
  5443.                     will be  freed. All  files and  windows  open  will  be
  5444.                     closed and any memory allocated for them will be freed.
  5445.  
  5446.  
  5447.           See also
  5448.           See also
  5449.           ________
  5450.                     scinit.
  5451.                     scinit 
  5452.  
  5453.  
  5454.           Return Value
  5455.           Return Value
  5456.           ____________
  5457.                     SC_SUCCESS     completed initialization
  5458.  
  5459.  
  5460.           Example
  5461.           Example
  5462.           _______
  5463.  
  5464.           #include "SoftC.h"
  5465.           
  5466.           void main()
  5467.           {
  5468.             scinit(20,20);
  5469.             scterm();
  5470.           }
  5471.  
  5472.  
  5473.           74    Chapter 7, The SoftC Library
  5474.           74                                
  5475.  
  5476.  
  5477.           scvers
  5478.           scvers
  5479.           ______
  5480.  
  5481.  
  5482.  
  5483.  
  5484.           Usage
  5485.           Usage
  5486.           _____
  5487.                     signed char * scvers( void );
  5488.                                   scvers         
  5489.  
  5490.  
  5491.           Prototype in
  5492.           Prototype in
  5493.           ____________
  5494.                     SoftC.h
  5495.  
  5496.  
  5497.           Description
  5498.           Description
  5499.           ___________
  5500.                     scvers gets the SoftC library revision in the form of a
  5501.                     scvers                                                 
  5502.                     character string.
  5503.  
  5504.  
  5505.           Return Value
  5506.           Return Value
  5507.           ____________
  5508.                     scvers returns the library revision.
  5509.                     scvers                              
  5510.  
  5511.  
  5512.           Example
  5513.           Example
  5514.           _______
  5515.  
  5516.           #include "SoftC.h"
  5517.           #include "windows.h"
  5518.           
  5519.           void main()
  5520.           {
  5521.             scinit(20,20);
  5522.             scwprintf("SoftC Library Revision %s",scvers());
  5523.             scterm();
  5524.           }
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.           scwaget
  5531.           scwaget
  5532.           _______
  5533.  
  5534.  
  5535.  
  5536.  
  5537.           Usage
  5538.           Usage
  5539.           _____
  5540.                     void scwaget( unsigned char *foreground,
  5541.                          scwaget                            
  5542.                                                  __________ 
  5543.                                   unsigned char *background );
  5544.                                                  __________   
  5545.  
  5546.  
  5547.           Prototype in
  5548.           Prototype in
  5549.           ____________
  5550.                     windows.h
  5551.  
  5552.  
  5553.                                          Chapter 7, The SoftC Library    75
  5554.                                                                          75
  5555.  
  5556.  
  5557.           Description
  5558.           Description
  5559.           ___________
  5560.                     scwaget gets the current text foreground and background
  5561.                     scwaget                                                
  5562.                                                   __________     __________
  5563.                     color attributes.
  5564.  
  5565.  
  5566.           See also
  5567.           See also
  5568.           ________
  5569.                     scwaput.
  5570.                     scwaput 
  5571.  
  5572.  
  5573.           Return Value
  5574.           Return Value
  5575.           ____________
  5576.                     None.
  5577.  
  5578.  
  5579.           Example
  5580.           Example
  5581.           _______
  5582.  
  5583.           #include "SoftC.h"
  5584.           #include "windows.h"
  5585.           
  5586.           void main()
  5587.           {
  5588.             unsigned char foreground,background;
  5589.           
  5590.             scinit(20,20);
  5591.             scwaget(&foreground,&background);
  5592.             scwprintf("%d %d",foreground,background);
  5593.             scterm();
  5594.           }
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.           scwaput
  5601.           scwaput
  5602.           _______
  5603.  
  5604.  
  5605.  
  5606.  
  5607.           Usage
  5608.           Usage
  5609.           _____
  5610.                     void scwaput( unsigned char foreground,
  5611.                          scwaput                           
  5612.                                                 __________ 
  5613.                                   unsigned char background );
  5614.                                                 __________   
  5615.  
  5616.  
  5617.           Prototype in
  5618.           Prototype in
  5619.           ____________
  5620.                     windows.h
  5621.  
  5622.  
  5623.           Description
  5624.           Description
  5625.           ___________
  5626.                     scwaput sets  the text  foreground and background color
  5627.                     scwaput                                                
  5628.                                             __________     __________      
  5629.                     attributes.
  5630.  
  5631.  
  5632.           See also
  5633.           See also
  5634.           ________
  5635.                     scwaget.
  5636.                     scwaget 
  5637.  
  5638.  
  5639.           76    Chapter 7, The SoftC Library
  5640.           76                                
  5641.  
  5642.  
  5643.           Return Value
  5644.           Return Value
  5645.           ____________
  5646.                     None.
  5647.  
  5648.  
  5649.           Example
  5650.           Example
  5651.           _______
  5652.  
  5653.           #include <conio.h>
  5654.           #include "SoftC.h"
  5655.           #include "windows.h"
  5656.           
  5657.           void main()
  5658.           {
  5659.             scinit(20,20);
  5660.           /* blinking yellow on black */
  5661.             scwaput(YELLOW + BLINK,BLACK);
  5662.             scwputs("Hello world!");
  5663.             scterm();
  5664.           }
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.           scwbget
  5671.           scwbget
  5672.           _______
  5673.  
  5674.  
  5675.  
  5676.  
  5677.           Usage
  5678.           Usage
  5679.           _____
  5680.                     signed short int scwbget( signed char offset,
  5681.                                      scwbget                     
  5682.                                                           ______ 
  5683.                                               unsigned char *uplft,         
  5684.                                                              _____          
  5685.                                               unsigned char *uprght,
  5686.                                                              ______ 
  5687.                                               unsigned char *lowlft,
  5688.                                                              ______ 
  5689.                                               unsigned char *lowrght,
  5690.                                                              _______ 
  5691.                                               unsigned char *horiz,
  5692.                                                              _____ 
  5693.                                               unsigned char *vert );
  5694.                                                              ____   
  5695.  
  5696.  
  5697.           Prototype in
  5698.           Prototype in
  5699.           ____________
  5700.                     windows.h
  5701.  
  5702.  
  5703.           Description
  5704.           Description
  5705.           ___________
  5706.                     scwbget  is   used  to  retrieve  window  border  style
  5707.                     scwbget                                                
  5708.                     information.
  5709.  
  5710.  
  5711.                     This is  where each  border character will be displayed
  5712.                     in relation  to the  other border  characters  of  this
  5713.                     style:
  5714.  
  5715.  
  5716.                                          Chapter 7, The SoftC Library    77
  5717.                                                                          77
  5718.  
  5719.  
  5720.                     uplft     horiz     uprght
  5721.                     vert                vert
  5722.                     lowlft    horiz     lowrght
  5723.  
  5724.  
  5725.                     There are four (4) predefined border styles:
  5726.  
  5727.  
  5728.                     ┌───┐     ╔═══╗     ╒═══╕     ╓───╖
  5729.                     │ 0 │     ║ 1 ║     │ 2 │     ║ 3 ║
  5730.                     └───┘     ╚═══╝     ╘═══╛     ╙───╜
  5731.  
  5732.  
  5733.                     There is  only room  for four styles in the array, if a
  5734.                     different style  is desired  one of  the default styles
  5735.                     will have to be overwritten using scwbput.
  5736.                                                       scwbput 
  5737.  
  5738.  
  5739.                     Border style zero (0) is the default style for scwopen.
  5740.                                                                    scwopen 
  5741.                     The characters  found in style zero will always be used
  5742.                     by scwopen.  These characters  can easily be changed by
  5743.                        scwopen                                             
  5744.                     scwbput
  5745.                     scwbput
  5746.  
  5747.  
  5748.           See also
  5749.           See also
  5750.           ________
  5751.                     scwbput.
  5752.                     scwbput 
  5753.  
  5754.  
  5755.           Return Value
  5756.           Return Value
  5757.           ____________
  5758.                     SC_SUCCESS     record recovered
  5759.                     SC_BADOFS      invalid border array offset
  5760.  
  5761.  
  5762.           Example
  5763.           Example
  5764.           _______
  5765.  
  5766.           #include "SoftC.h"
  5767.           #include "windows.h"
  5768.           
  5769.           void main()
  5770.           {
  5771.             unsigned char ul,ur,ll,lr,h,v;
  5772.           
  5773.             scinit(20,20);
  5774.           /* changes the default window border style */
  5775.             scwbget(3,&ul,&ur,&ll,&lr,&h,&v);
  5776.             scwbput(0,ul,ur,ll,lr,h,v);
  5777.             scterm();
  5778.           }
  5779.  
  5780.  
  5781.           78    Chapter 7, The SoftC Library
  5782.           78                                
  5783.  
  5784.  
  5785.           scwbput
  5786.           scwbput
  5787.           _______
  5788.  
  5789.  
  5790.  
  5791.  
  5792.           Usage
  5793.           Usage
  5794.           _____
  5795.                     signed short int scwbput( signed char offset,
  5796.                                      scwbput                     
  5797.                                                           ______ 
  5798.                                               unsigned char uplft,          
  5799.                                                             _____           
  5800.                                               unsigned char uprght,
  5801.                                                             ______ 
  5802.                                               unsigned char lowlft,
  5803.                                                             ______ 
  5804.                                               unsigned char lowrght,
  5805.                                                             _______ 
  5806.                                               unsigned char horiz,
  5807.                                                             _____ 
  5808.                                               unsigned char vert );
  5809.                                                             ____   
  5810.  
  5811.  
  5812.           Prototype in
  5813.           Prototype in
  5814.           ____________
  5815.                     windows.h
  5816.  
  5817.  
  5818.           Description
  5819.           Description
  5820.           ___________
  5821.                     scwbput is  used to redefine a window border style. The
  5822.                     scwbput                                                
  5823.                     six characters to be used when drawing a window outline
  5824.                     are supplied along with an index into the window border
  5825.                     array.
  5826.  
  5827.  
  5828.                     This is  where each  character  will  be  displayed  in
  5829.                     relation to the other new border style characters:
  5830.  
  5831.  
  5832.                     uplft     horiz     uprght
  5833.                     vert                vert
  5834.                     lowlft    horiz     lowrght
  5835.  
  5836.  
  5837.           See also
  5838.           See also
  5839.           ________
  5840.                     scwbget.
  5841.                     scwbget 
  5842.  
  5843.  
  5844.           Return Value
  5845.           Return Value
  5846.           ____________
  5847.                     SC_SUCCESS     record recovered
  5848.                     SC_BADOFS      invalid border array offset
  5849.  
  5850.  
  5851.           Example
  5852.           Example
  5853.           _______
  5854.  
  5855.           #include "SoftC.h"
  5856.           #include "windows.h"
  5857.           
  5858.           void main()
  5859.           {
  5860.             unsigned char ul,ur,ll,lr,h,v;
  5861.           
  5862.             scinit(20,20);
  5863.  
  5864.  
  5865.                                          Chapter 7, The SoftC Library    79
  5866.                                                                          79
  5867.  
  5868.  
  5869.           /* changes the default window border style */
  5870.             scwbget(3,&ul,&ur,&ll,&lr,&h,&v);
  5871.             scwbput(0,ul,ur,ll,lr,h,v);
  5872.             scterm();
  5873.           }
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.           scwcget
  5880.           scwcget
  5881.           _______
  5882.  
  5883.  
  5884.  
  5885.  
  5886.           Usage
  5887.           Usage
  5888.           _____
  5889.                     signed short int scwcget( signed char offset,
  5890.                                      scwcget                     
  5891.                                                           ______ 
  5892.                                               unsigned char *hfore,         
  5893.                                                              _____          
  5894.                                               unsigned char *hback,
  5895.                                                              _____ 
  5896.                                               unsigned char *bfore,
  5897.                                                              _____ 
  5898.                                               unsigned char *bback,
  5899.                                                              _____ 
  5900.                                               unsigned char *tfore,
  5901.                                                              _____ 
  5902.                                               unsigned char *tback);
  5903.                                                              _____  
  5904.  
  5905.  
  5906.           Prototype in
  5907.           Prototype in
  5908.           ____________
  5909.                     windows.h
  5910.  
  5911.  
  5912.           Description
  5913.           Description
  5914.           ___________
  5915.                     scwcget  is   used  to  retrieve  window  color  scheme
  5916.                     scwcget                                                
  5917.                     information. Three  pairs of  color information will be
  5918.                     returned:  title   foreground  (hfore)  and  background
  5919.                                                     _____                  
  5920.                     (hback),  border   foreground  (bfore)  and  background
  5921.                      _____                          _____                  
  5922.                     (bback), and  text foreground  (tfore)  and  background
  5923.                      _____                          _____                  
  5924.                     (tback) colors.
  5925.                      _____         
  5926.  
  5927.  
  5928.                     There are ten (10) predefined window color schemes:
  5929.  
  5930.  
  5931.                     Scheme 0:
  5932.                     Title:    Light Gray on Blue.
  5933.                     Border:   Light Gray on Blue.
  5934.                     Text:     Light Gray on Blue.
  5935.  
  5936.  
  5937.                     Scheme 1:
  5938.                     Title:    Light Gray on Green.
  5939.                     Border:   Light Gray on Green.
  5940.                     Text:     Light Gray on Green.
  5941.  
  5942.  
  5943.           80    Chapter 7, The SoftC Library
  5944.           80                                
  5945.  
  5946.  
  5947.                     Scheme 2:
  5948.                     Title:    Light Gray on Red.
  5949.                     Border:   Light Gray on Red.
  5950.                     Text:     Light Gray on Red.
  5951.  
  5952.  
  5953.                     Scheme 3:
  5954.                     Title:    White on Black.
  5955.                     Border:   White on Black.
  5956.                     Text:     White on Black.
  5957.  
  5958.  
  5959.                     Scheme 4:
  5960.                     Title:    Blue on Black.
  5961.                     Border:   Blue on Black.
  5962.                     Text:     Blue on Black.
  5963.  
  5964.  
  5965.                     Scheme 5:
  5966.                     Title:    Green on Black.
  5967.                     Border:   Green on Black.
  5968.                     Text:     Green on Black.
  5969.  
  5970.  
  5971.                     Scheme 6:
  5972.                     Title:    Cyan on Black.
  5973.                     Border:   Cyan on Black.
  5974.                     Text:     Cyan on Black.
  5975.  
  5976.  
  5977.                     Scheme 7:
  5978.                     Title:    Red on Black.
  5979.                     Border:   Red on Black.
  5980.                     Text:     Red on Black.
  5981.  
  5982.  
  5983.                     Scheme 8:
  5984.                     Title:    Magenta on Black.
  5985.                     Border:   Magenta on Black.
  5986.                     Text:     Magenta on Black.
  5987.  
  5988.  
  5989.                     Scheme 9:
  5990.                     Title:    Brown on Black.
  5991.                     Border:   Brown on Black.
  5992.                     Text:     Brown on Black.
  5993.  
  5994.  
  5995.                     If scinit  senses a monochrome monitor the entire color
  5996.                        scinit                                              
  5997.                     table will be written to all yellow foreground on black
  5998.                     background.
  5999.  
  6000.  
  6001.                                          Chapter 7, The SoftC Library    81
  6002.                                                                          81
  6003.  
  6004.  
  6005.                     There is  only room  for ten schemes in the array, if a
  6006.                     different one  is desired  one of  the default  schemes
  6007.                     will have to be overwritten using scwcput.
  6008.                                                       scwcput 
  6009.  
  6010.  
  6011.                     Color  scheme  zero  (0)  is  the  default  scheme  for
  6012.                     scwopen. The colors found in scheme zero will always be
  6013.                     scwopen                                                
  6014.                     used by  scwopen. These colors can easily be changed by
  6015.                              scwopen                                       
  6016.                     scwcput.
  6017.                     scwcput 
  6018.  
  6019.  
  6020.           See also
  6021.           See also
  6022.           ________
  6023.                     scwcput.
  6024.                     scwcput 
  6025.  
  6026.  
  6027.           Return Value
  6028.           Return Value
  6029.           ____________
  6030.                     SC_SUCCESS     record recovered
  6031.                     SC_BADOFS      invalid border array offset
  6032.  
  6033.  
  6034.           Example
  6035.           Example
  6036.           _______
  6037.  
  6038.           #include "SoftC.h"
  6039.           #include "windows.h"
  6040.           
  6041.           void main()
  6042.           {
  6043.             unsigned char hf,hb,bf,bb,tf,tb;
  6044.           
  6045.             scinit(20,20);
  6046.           /* changes the default window color scheme */
  6047.             scwcget(3,&hf,&hb,&bf,&bb,&tf,&tb);
  6048.             scwcput(0,hf,hb,bf,bb,tf,tb);
  6049.             scterm();
  6050.           }
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.           scwclose
  6057.           scwclose
  6058.           ________
  6059.  
  6060.  
  6061.  
  6062.  
  6063.           Usage
  6064.           Usage
  6065.           _____
  6066.                     signed short int scwclose( signed char handle );
  6067.                                      scwclose                       
  6068.                                                            ______   
  6069.  
  6070.  
  6071.           Prototype in
  6072.           Prototype in
  6073.           ____________
  6074.                     windows.h
  6075.  
  6076.  
  6077.           82    Chapter 7, The SoftC Library
  6078.           82                                
  6079.  
  6080.  
  6081.           Description
  6082.           Description
  6083.           ___________
  6084.                     scwclose closes a window and frees all allocated memory
  6085.                     scwclose                                               
  6086.                     associated with  that window. Actual screen information
  6087.                     overlaid by window will be restored.
  6088.  
  6089.  
  6090.                     If the  window attempting  to be  closed is overlaid by
  6091.                     another window  the close  will be ignored and an error
  6092.                     will be returned.
  6093.  
  6094.  
  6095.                     If the  current window  is  being  closed,  the  window
  6096.                     opened (or  selected) just prior to this window will be
  6097.                     selected. If  no other  windows remain  to be selected,
  6098.                     the entire screen will be selected.
  6099.  
  6100.  
  6101.           See also
  6102.           See also
  6103.           ________
  6104.                     scwopen, scwopenx, scwselect.
  6105.                     scwopen  scwopenx  scwselect 
  6106.  
  6107.  
  6108.           Return Value
  6109.           Return Value
  6110.           ____________
  6111.                     SC_SUCCESS     window file closed
  6112.                     SC_BADHNDL     invalid window handle
  6113.                     SC_WINOVRLAD   window is overlaid by another
  6114.  
  6115.  
  6116.           Example
  6117.           Example
  6118.           _______
  6119.  
  6120.           #include "SoftC.h"
  6121.           #include "windows.h"
  6122.           
  6123.           void main()
  6124.           {
  6125.             char win;
  6126.           
  6127.             scinit(20,20);
  6128.             if (scwopen(&win,5,5,20,1) == SC_SUCCESS) {
  6129.               scwputs("Hello world!");
  6130.               scwclose(win);
  6131.             }
  6132.             scterm();
  6133.           }
  6134.  
  6135.  
  6136.                                          Chapter 7, The SoftC Library    83
  6137.                                                                          83
  6138.  
  6139.  
  6140.           scwclr
  6141.           scwclr
  6142.           ______
  6143.  
  6144.  
  6145.  
  6146.  
  6147.           Usage
  6148.           Usage
  6149.           _____
  6150.                     void scwclr( void );
  6151.                          scwclr         
  6152.  
  6153.  
  6154.           Prototype in
  6155.           Prototype in
  6156.           ____________
  6157.                     windows.h
  6158.  
  6159.  
  6160.           Description
  6161.           Description
  6162.           ___________
  6163.                     scwclr clears  the currently selected window (or, if no
  6164.                     scwclr                                                 
  6165.                     windows are  open, the  entire screen). The cursor will
  6166.                     be moved  to  the  upper  left  corner  of  the  window
  6167.                     (screen).
  6168.  
  6169.  
  6170.           See also
  6171.           See also
  6172.           ________
  6173.                     scwclreol.
  6174.                     scwclreol 
  6175.  
  6176.  
  6177.           Return Value
  6178.           Return Value
  6179.           ____________
  6180.                     None.
  6181.  
  6182.  
  6183.           Example
  6184.           Example
  6185.           _______
  6186.  
  6187.           #include "SoftC.h"
  6188.           #include "windows.h"
  6189.           
  6190.           void main()
  6191.           {
  6192.             scinit(20,20);
  6193.             scwclr();
  6194.             scwputs("Hello world!");
  6195.             scterm();
  6196.           }
  6197.  
  6198.  
  6199.  
  6200.  
  6201.  
  6202.           scwclreol
  6203.           scwclreol
  6204.           _________
  6205.  
  6206.  
  6207.  
  6208.  
  6209.           Usage
  6210.           Usage
  6211.           _____
  6212.                     void scwclreol( void );
  6213.                          scwclreol         
  6214.  
  6215.  
  6216.           84    Chapter 7, The SoftC Library
  6217.           84                                
  6218.  
  6219.  
  6220.           Prototype in
  6221.           Prototype in
  6222.           ____________
  6223.                     windows.h
  6224.  
  6225.  
  6226.           Description
  6227.           Description
  6228.           ___________
  6229.                     scwclreol clears  from the  current cursor  position to
  6230.                     scwclreol                                              
  6231.                     the end  of the  current line.  If a window is open, it
  6232.                     will clear  to the  edge of the window. The cursor will
  6233.                     not be advanced.
  6234.  
  6235.  
  6236.           See also
  6237.           See also
  6238.           ________
  6239.                     scwclr.
  6240.                     scwclr 
  6241.  
  6242.  
  6243.           Return Value
  6244.           Return Value
  6245.           ____________
  6246.                     None.
  6247.  
  6248.  
  6249.           Example
  6250.           Example
  6251.           _______
  6252.  
  6253.           #include "SoftC.h"
  6254.           #include "windows.h"
  6255.           
  6256.           void main()
  6257.           {
  6258.             scinit(20,20);
  6259.             scwputs("Hello world!");
  6260.             scwgoto(6,1);
  6261.             scwclreol();
  6262.             scterm();
  6263.           }
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.           scwcput
  6270.           scwcput
  6271.           _______
  6272.  
  6273.  
  6274.  
  6275.  
  6276.           Usage
  6277.           Usage
  6278.           _____
  6279.                     signed short int scwcput( signed char offset,
  6280.                                      scwcput                     
  6281.                                                           ______ 
  6282.                                               unsigned char hfore,
  6283.                                                             _____ 
  6284.                                               unsigned char hback,
  6285.                                                             _____ 
  6286.                                               unsigned char bfore,
  6287.                                                             _____ 
  6288.                                               unsigned char bback,
  6289.                                                             _____ 
  6290.                                               unsigned char tfore,
  6291.                                                             _____ 
  6292.                                               unsigned char tback);
  6293.                                                             _____  
  6294.  
  6295.  
  6296.           Prototype in
  6297.           Prototype in
  6298.           ____________
  6299.                     windows.h
  6300.  
  6301.  
  6302.                                          Chapter 7, The SoftC Library    85
  6303.                                                                          85
  6304.  
  6305.  
  6306.           Description
  6307.           Description
  6308.           ___________
  6309.                     scwcput is  used to  redefine a  window  color  scheme.
  6310.                     scwcput                                                
  6311.                     Three pairs  of color  information  will  be  returned:
  6312.                     title foreground (hfore) and background (hback), border
  6313.                                       _____                  _____         
  6314.                     foreground (bfore)  and background  (bback),  and  text
  6315.                                 _____                    _____             
  6316.                     foreground (tfore) and background (tback) colors.
  6317.                                 _____                  _____         
  6318.  
  6319.  
  6320.           See also
  6321.           See also
  6322.           ________
  6323.                     scwcget.
  6324.                     scwcget 
  6325.  
  6326.  
  6327.           Return Value
  6328.           Return Value
  6329.           ____________
  6330.                     SC_SUCCESS     record recovered
  6331.                     SC_BADOFS      invalid border array offset
  6332.  
  6333.  
  6334.           Example
  6335.           Example
  6336.           _______
  6337.  
  6338.           #include "SoftC.h"
  6339.           #include "windows.h"
  6340.           
  6341.           void main()
  6342.           {
  6343.             unsigned char ul,ur,ll,lr,h,v;
  6344.           
  6345.             scinit(20,20);
  6346.           /* changes the default window color scheme */
  6347.             scwcget(3,&hf,&hb,&bf,&bb,&tf,&tb);
  6348.             scwcput(0,hf,hb,bf,bb,tf,tb);
  6349.             scterm();
  6350.           }
  6351.  
  6352.  
  6353.  
  6354.  
  6355.  
  6356.           scwcursoff
  6357.           scwcursoff
  6358.           __________
  6359.  
  6360.  
  6361.  
  6362.  
  6363.           Usage
  6364.           Usage
  6365.           _____
  6366.                     void scwcursoff( void );
  6367.                          scwcursoff         
  6368.  
  6369.  
  6370.           Prototype in
  6371.           Prototype in
  6372.           ____________
  6373.                     windows.h
  6374.  
  6375.  
  6376.           Description
  6377.           Description
  6378.           ___________
  6379.                     scwcursoff will  turn off  the blinking cursor. It does
  6380.                     scwcursoff                                             
  6381.                     not affect  the cursor  positioning (scwgoto) or any of
  6382.                                                          scwgoto           
  6383.                     the window printing functions.
  6384.  
  6385.  
  6386.           86    Chapter 7, The SoftC Library
  6387.           86                                
  6388.  
  6389.  
  6390.           See also
  6391.           See also
  6392.           ________
  6393.                     scwcurson.
  6394.                     scwcurson 
  6395.  
  6396.  
  6397.           Return Value
  6398.           Return Value
  6399.           ____________
  6400.                     None.
  6401.  
  6402.  
  6403.           Example
  6404.           Example
  6405.           _______
  6406.  
  6407.           #include "SoftC.h"
  6408.           #include "windows.h"
  6409.           
  6410.           void main()
  6411.           {
  6412.             scinit(1,1);
  6413.             scwcursoff();
  6414.             scwprintf("Hello");
  6415.             scwcurson();
  6416.             scterm();
  6417.           }
  6418.  
  6419.  
  6420.  
  6421.  
  6422.  
  6423.           scwcurso
  6424.           scwcurso
  6425.           ________
  6426.  
  6427.  
  6428.  
  6429.  
  6430.           Usage
  6431.           Usage
  6432.           _____
  6433.                     void scwcurson( void );
  6434.                          scwcurson         
  6435.  
  6436.  
  6437.           Prototype in
  6438.           Prototype in
  6439.           ____________
  6440.                     windows.h
  6441.  
  6442.  
  6443.           Description
  6444.           Description
  6445.           ___________
  6446.                     scwcurson will turn on the blinking cursor. It does not
  6447.                     scwcurson                                              
  6448.                     affect the  cursor positioning  (scwgoto) or any of the
  6449.                                                      scwgoto               
  6450.                     window printing functions.
  6451.  
  6452.  
  6453.           See also
  6454.           See also
  6455.           ________
  6456.                     scwcursoff.
  6457.                     scwcursoff 
  6458.  
  6459.  
  6460.           Return Value
  6461.           Return Value
  6462.           ____________
  6463.                     None.
  6464.  
  6465.  
  6466.                                          Chapter 7, The SoftC Library    87
  6467.                                                                          87
  6468.  
  6469.  
  6470.           Example
  6471.           Example
  6472.           _______
  6473.  
  6474.           #include "SoftC.h"
  6475.           #include "windows.h"
  6476.           
  6477.           void main()
  6478.           {
  6479.             scinit(1,1);
  6480.             scwcursoff();
  6481.             scwprintf("Hello");
  6482.             scwcurson();
  6483.             scterm();
  6484.           }
  6485.  
  6486.  
  6487.  
  6488.  
  6489.  
  6490.           scwgoto
  6491.           scwgoto
  6492.           _______
  6493.  
  6494.  
  6495.  
  6496.  
  6497.           Usage
  6498.           Usage
  6499.           _____
  6500.                     signed short int scwgoto( unsigned short int x,
  6501.                                      scwgoto                       
  6502.                                                                  _ 
  6503.                                               unsigned short int y );
  6504.                                                                  _   
  6505.  
  6506.  
  6507.           Prototype in
  6508.           Prototype in
  6509.           ____________
  6510.                     windows.h
  6511.  
  6512.  
  6513.           Description
  6514.           Description
  6515.           ___________
  6516.                     scwgoto moves the cursor to the desired position within
  6517.                     scwgoto                                                
  6518.                     the current  window (or screen if no windows are open).
  6519.                     If  the  coordinates  are  invalid  the  call  will  be
  6520.                     ignored.
  6521.  
  6522.  
  6523.                     The upper  left corner  of the  window is column 1 (x),
  6524.                                                                         _  
  6525.                     row 1 (y).
  6526.                            _  
  6527.  
  6528.  
  6529.           See also
  6530.           See also
  6531.           ________
  6532.                     scwxloc, scwyloc.
  6533.                     scwxloc  scwyloc 
  6534.  
  6535.  
  6536.           Return Value
  6537.           Return Value
  6538.           ____________
  6539.                     SC_SUCCESS     record recovered
  6540.                     SC_BADCOORDS   invalid window coordinates
  6541.  
  6542.  
  6543.           88    Chapter 7, The SoftC Library
  6544.           88                                
  6545.  
  6546.  
  6547.           Example
  6548.           Example
  6549.           _______
  6550.  
  6551.           #include "SoftC.h"
  6552.           #include "windows.h"
  6553.           
  6554.           void main()
  6555.           {
  6556.           
  6557.             scinit(20,20);
  6558.             scwgoto(10,20);
  6559.             scterm();
  6560.           }
  6561.  
  6562.  
  6563.  
  6564.  
  6565.  
  6566.           scwinfo
  6567.           scwinfo
  6568.           _______
  6569.  
  6570.  
  6571.  
  6572.  
  6573.           Usage
  6574.           Usage
  6575.           _____
  6576.                     signed short int scwinfo( signed char handle,
  6577.                                      scwinfo                     
  6578.                                                           ______ 
  6579.                                               unsigned short int *left,
  6580.                                                                   ____ 
  6581.                                               unsigned short int *top,
  6582.                                                                   ___ 
  6583.                                               unsigned short int *width,
  6584.                                                                   _____ 
  6585.                                               unsigned short int *height,
  6586.                                                                   ______ 
  6587.                                               signed char *hlen,
  6588.                                                            ____ 
  6589.                                               signed char *color,
  6590.                                                            _____ 
  6591.                                               signed char *border );
  6592.                                                            ______   
  6593.  
  6594.  
  6595.           Prototype in
  6596.           Prototype in
  6597.           ____________
  6598.                     windows.h
  6599.  
  6600.  
  6601.           Description
  6602.           Description
  6603.           ___________
  6604.                     scwinfo returns the parameters used to open the window.
  6605.                     scwinfo                                                
  6606.                     The coordinates  of the  upper left  hand corner of the
  6607.                     window (left, top), the width and height of the window,
  6608.                             ____  ___       _____     ______               
  6609.                     the window  title length (hlen), color scheme (color is
  6610.                                               ____                 _____   
  6611.                     an index into the color scheme table), and border style
  6612.                     (border is  an index  into the border style table) will
  6613.                      ______                                                
  6614.                     be returned.
  6615.  
  6616.  
  6617.           See also
  6618.           See also
  6619.           ________
  6620.                     scwopen, scwopenx.
  6621.                     scwopen  scwopenx 
  6622.  
  6623.  
  6624.           Return Value
  6625.           Return Value
  6626.           ____________
  6627.                     SC_SUCCESS     window opened and memory allocated
  6628.                     SC_BADHNDL     too many open windows
  6629.  
  6630.  
  6631.                                          Chapter 7, The SoftC Library    89
  6632.                                                                          89
  6633.  
  6634.  
  6635.           Example
  6636.           Example
  6637.           _______
  6638.  
  6639.           #include "SoftC.h"
  6640.           #include "windows.h"
  6641.           
  6642.           void main()
  6643.           {
  6644.             char win,hdrl,b,c;
  6645.             int l,t,w,h;
  6646.           
  6647.             scinit(20,20);
  6648.             scwopenx(&win,5,5,20,1,NULL,3,-1);
  6649.             scwinfo(win,&l,&t,&w,&h,hdrl,&b,&c);
  6650.             scwprintf("%u %u %u %u %d %d %d",
  6651.                     l,t,w,h,hdrl,b,c);
  6652.             scwclose(win);
  6653.             scterm();
  6654.           }
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.           scwopen
  6661.           scwopen
  6662.           _______
  6663.  
  6664.  
  6665.  
  6666.  
  6667.           Usage
  6668.           Usage
  6669.           _____
  6670.                     signed short int scwopen( signed char *handle,
  6671.                                      scwopen                      
  6672.                                                            ______ 
  6673.                                               unsigned short int left,
  6674.                                                                  ____ 
  6675.                                               unsigned short int top,
  6676.                                                                  ___ 
  6677.                                               unsigned short int width,
  6678.                                                                  _____ 
  6679.                                               unsigned short int height );
  6680.                                                                  ______   
  6681.  
  6682.  
  6683.           Prototype in
  6684.           Prototype in
  6685.           ____________
  6686.                     windows.h
  6687.  
  6688.  
  6689.           Description
  6690.           Description
  6691.           ___________
  6692.                     scwopen opens  a window  on the  screen. Memory will be
  6693.                     scwopen                                                
  6694.                     allocated for  a window  packet and screen image buffer
  6695.                     for use internally by the SoftC window manager.
  6696.  
  6697.  
  6698.                     The window  border will  be drawn  using  border  style
  6699.                     zero. The  colors used in the window will be defined by
  6700.                     color style  zero. The  window will  be cleared and the
  6701.                     cursor moved  to the upper left corner (of the window).
  6702.                     Upon exit the new window will be the current window.
  6703.  
  6704.  
  6705.           90    Chapter 7, The SoftC Library
  6706.           90                                
  6707.  
  6708.  
  6709.                     A copy  of the  original screen  overlaid  by  the  new
  6710.                     window will be kept.
  6711.  
  6712.  
  6713.           See also
  6714.           See also
  6715.           ________
  6716.                     scwclose, scwbget, scwcget.
  6717.                     scwclose  scwbget  scwcget 
  6718.  
  6719.  
  6720.           Return Value
  6721.           Return Value
  6722.           ____________
  6723.                     SC_SUCCESS     window opened and memory allocated
  6724.                     SC_MEMERR      memory allocation failure
  6725.                     SC_BADCOORDS   invalid screen coordinates
  6726.                     SC_NOHNDL      too many open windows
  6727.                     SC_BADOFS      invalid color or border array offset
  6728.  
  6729.  
  6730.           Example
  6731.           Example
  6732.           _______
  6733.  
  6734.           #include "SoftC.h"
  6735.           #include "windows.h"
  6736.           
  6737.           void main()
  6738.           {
  6739.             char win;
  6740.           
  6741.             scinit(20,20);
  6742.             if (scwopen(&win,5,5,20,1) == SC_SUCCESS) {
  6743.               scwputs("Hello world!");
  6744.               scwclose(win);
  6745.             }
  6746.             scterm();
  6747.           }
  6748.  
  6749.  
  6750.  
  6751.  
  6752.  
  6753.           scwopenx
  6754.           scwopenx
  6755.           ________
  6756.  
  6757.  
  6758.  
  6759.  
  6760.           Usage
  6761.           Usage
  6762.           _____
  6763.                     signed short int scwopenx( signed char *handle,
  6764.                                      scwopenx                      
  6765.                                                             ______ 
  6766.                                                unsigned short int left,
  6767.                                                                   ____ 
  6768.                                                unsigned short int top,
  6769.                                                                   ___ 
  6770.                                                unsigned short int width,
  6771.                                                                   _____ 
  6772.                                                unsigned short int height,
  6773.                                                                   ______ 
  6774.                                                signed char *header,
  6775.                                                             ______ 
  6776.                                                signed char color,
  6777.                                                            _____ 
  6778.                                                signed char border );
  6779.                                                            ______   
  6780.  
  6781.  
  6782.                                          Chapter 7, The SoftC Library    91
  6783.                                                                          91
  6784.  
  6785.  
  6786.           Prototype in
  6787.           Prototype in
  6788.           ____________
  6789.                     windows.h
  6790.  
  6791.  
  6792.           Description
  6793.           Description
  6794.           ___________
  6795.                     scwopenx  is  an  extended  version  of  scwopen.  This
  6796.                     scwopenx                                 scwopen       
  6797.                     function allows  the user  to specify  a  window  title
  6798.                     (header) and gives control over window colors (color is
  6799.                      ______                                        _____   
  6800.                     an index into the window color table) and border styles
  6801.                     (border is an index into the border style table).
  6802.                      ______                                          
  6803.  
  6804.  
  6805.                     One option  available under  .i.scwopenx; is to specify
  6806.                     that no  window border  should be  drawn when opening a
  6807.                     window. By  using a  minus  one  (-1)  for  the  border
  6808.                                                                      ______
  6809.                     parameter a borderless window will be opened.
  6810.  
  6811.  
  6812.           See also
  6813.           See also
  6814.           ________
  6815.                     scwopen.
  6816.                     scwopen 
  6817.  
  6818.  
  6819.           Return Value
  6820.           Return Value
  6821.           ____________
  6822.                     SC_SUCCESS     window opened and memory allocated
  6823.                     SC_MEMERR      memory allocation failure
  6824.                     SC_BADCOORDS   invalid screen coordinates
  6825.                     SC_NOHNDL      too many open windows
  6826.                     SC_BADOFS      invalid color or border array offset
  6827.  
  6828.  
  6829.           Example
  6830.           Example
  6831.           _______
  6832.  
  6833.           #include "SoftC.h"
  6834.           #include "windows.h"
  6835.           
  6836.           void main()
  6837.           {
  6838.             char win;
  6839.           
  6840.             scinit(20,20);
  6841.           /* open a window with no border */
  6842.             if (scwopenx(&win,5,5,20,1,NULL,3,-1) == SC_SUCCESS) {
  6843.               scwputs("Hello world!");
  6844.               scwclose(win);
  6845.             }
  6846.             scterm();
  6847.           }
  6848.  
  6849.  
  6850.           92    Chapter 7, The SoftC Library
  6851.           92                                
  6852.  
  6853.  
  6854.           scwprintf
  6855.           scwprintf
  6856.           _________
  6857.  
  6858.  
  6859.  
  6860.  
  6861.           Usage
  6862.           Usage
  6863.           _____
  6864.                     void scwprintf( signed char *format[, argument, ...] );
  6865.                          scwprintf                                         
  6866.                                                  ______   ________         
  6867.  
  6868.  
  6869.           Prototype in
  6870.           Prototype in
  6871.           ____________
  6872.                     windows.h
  6873.  
  6874.  
  6875.           Description
  6876.           Description
  6877.           ___________
  6878.                     scwprintf functions  the same  as the  printf  function
  6879.                     scwprintf                              printf          
  6880.                     found in  your compiler. It accepts an optional  series
  6881.                     of arguments  (argument),  applies  to  each  a  format
  6882.                                    ________                                
  6883.                     specification found in the string pointed to by format,
  6884.                                                                     ______ 
  6885.                     and outputs  the formatted  data to  an  internal  data
  6886.                     buffer. This  data buffer is then output to the current
  6887.                     window. See  the description of printf in your compiler
  6888.                                                     printf                 
  6889.                     manual for  more information. Note that if no window is
  6890.                     open the  text string  will be  output to  the  current
  6891.                     cursor position on the screen.
  6892.  
  6893.  
  6894.                     Because this  function uses  sprintf to  first build an
  6895.                                                  sprintf                   
  6896.                     output string  in an internal data buffer, care must be
  6897.                     exercised by  the user  to supply  a format  descriptor
  6898.                                                          ______            
  6899.                     which when  processed will result in a string no longer
  6900.                     than 256 characters (including terminating NULL bytes).
  6901.  
  6902.  
  6903.                     The cursor position will be updated.
  6904.  
  6905.  
  6906.                     Any newline  (\n) characters  found in  string will  be
  6907.                     translated into  a carriage  return -  line feed (\r\n)
  6908.                     sequence.
  6909.  
  6910.  
  6911.           See also
  6912.           See also
  6913.           ________
  6914.                     scwputc, scwputs.
  6915.                     scwputc  scwputs 
  6916.  
  6917.  
  6918.           Return Value
  6919.           Return Value
  6920.           ____________
  6921.                     None.
  6922.  
  6923.  
  6924.           Example
  6925.           Example
  6926.           _______
  6927.  
  6928.           #include "SoftC.h"
  6929.           #include "windows.h"
  6930.           
  6931.  
  6932.  
  6933.                                          Chapter 7, The SoftC Library    93
  6934.                                                                          93
  6935.  
  6936.  
  6937.           void main()
  6938.           {
  6939.           
  6940.             scinit(20,20);
  6941.             scwprintf("Hello world!");
  6942.             scterm();
  6943.           }
  6944.  
  6945.  
  6946.  
  6947.  
  6948.  
  6949.           scwputc
  6950.           scwputc
  6951.           _______
  6952.  
  6953.  
  6954.  
  6955.  
  6956.           Usage
  6957.           Usage
  6958.           _____
  6959.                     void scwputc( signed char ch );
  6960.                          scwputc                   
  6961.                                               __   
  6962.  
  6963.  
  6964.           Prototype in
  6965.           Prototype in
  6966.           ____________
  6967.                     windows.h
  6968.  
  6969.  
  6970.           Description
  6971.           Description
  6972.           ___________
  6973.                     scwputc will  put a single character out to the current
  6974.                     scwputc                                                
  6975.                     window. The cursor position will be updated.
  6976.  
  6977.  
  6978.                     The  newline   (\n)  character  is  translated  into  a
  6979.                     carriage return - line feed (\r\n) sequence.
  6980.  
  6981.  
  6982.                     scwputc is implemented as a macro:
  6983.                     scwputc                           
  6984.                          scwprintf("%c",ch);
  6985.                          scwprintf          
  6986.  
  6987.  
  6988.           See also
  6989.           See also
  6990.           ________
  6991.                     scwprintf, scwputs.
  6992.                     scwprintf  scwputs 
  6993.  
  6994.  
  6995.           Return Value
  6996.           Return Value
  6997.           ____________
  6998.                     None.
  6999.  
  7000.  
  7001.           Example
  7002.           Example
  7003.           _______
  7004.  
  7005.           #include "SoftC.h"
  7006.           #include "windows.h"
  7007.           
  7008.           void main()
  7009.           {
  7010.           
  7011.  
  7012.  
  7013.           94    Chapter 7, The SoftC Library
  7014.           94                                
  7015.  
  7016.  
  7017.             scinit(20,20);
  7018.             scwputc('H');
  7019.             scterm();
  7020.           }
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.           scwputs
  7027.           scwputs
  7028.           _______
  7029.  
  7030.  
  7031.  
  7032.  
  7033.           Usage
  7034.           Usage
  7035.           _____
  7036.                     void scwputs( signed char *string );
  7037.                          scwputs                        
  7038.                                                ______   
  7039.  
  7040.  
  7041.           Prototype in
  7042.           Prototype in
  7043.           ____________
  7044.                     windows.h
  7045.  
  7046.  
  7047.           Description
  7048.           Description
  7049.           ___________
  7050.                     scwputs will  put a  NULL terminated  string out to the
  7051.                     scwputs                                                
  7052.                                                           ______           
  7053.                     current window. The cursor position will be updated.
  7054.  
  7055.  
  7056.                     Unlike most  compiler's puts  functions, a newline (\n)
  7057.                                             puts                           
  7058.                     character is not appended to string.
  7059.  
  7060.  
  7061.                     Any  newline   characters  found   in  string  will  be
  7062.                     translated into  a carriage  return -  line feed (\r\n)
  7063.                     sequence.
  7064.  
  7065.  
  7066.                     scwputs is implemented as a macro:
  7067.                     scwputs                           
  7068.                          scwprintf("%s",string);
  7069.                          scwprintf              
  7070.  
  7071.  
  7072.           See also
  7073.           See also
  7074.           ________
  7075.                     scwprintf, scwputc.
  7076.                     scwprintf  scwputc 
  7077.  
  7078.  
  7079.           Return Value
  7080.           Return Value
  7081.           ____________
  7082.                     None.
  7083.  
  7084.  
  7085.           Example
  7086.           Example
  7087.           _______
  7088.  
  7089.           #include "SoftC.h"
  7090.           #include "windows.h"
  7091.           
  7092.           void main()
  7093.  
  7094.  
  7095.                                          Chapter 7, The SoftC Library    95
  7096.                                                                          95
  7097.  
  7098.  
  7099.           {
  7100.           
  7101.             scinit(20,20);
  7102.             scwputs("Hello world!");
  7103.             scterm();
  7104.           }
  7105.  
  7106.  
  7107.  
  7108.  
  7109.  
  7110.           scwselect
  7111.           scwselect
  7112.           _________
  7113.  
  7114.  
  7115.  
  7116.  
  7117.           Usage
  7118.           Usage
  7119.           _____
  7120.                     unsigned short int scwselect( signed char handle );
  7121.                                        scwselect                       
  7122.                                                               ______   
  7123.  
  7124.  
  7125.           Prototype in
  7126.           Prototype in
  7127.           ____________
  7128.                     windows.h
  7129.  
  7130.  
  7131.           Description
  7132.           Description
  7133.           ___________
  7134.                     scwselect makes  the window  specified  by  handle  the
  7135.                     scwselect                                              
  7136.                                                                 ______     
  7137.                     current window.  The current cursor x,y position in the
  7138.                     previously selected  window will  be saved.  The window
  7139.                     specified by  handle is  selected  and  the  cursor  is
  7140.                     restored to its previous location.
  7141.  
  7142.  
  7143.                     Note that  if the  window attempting  to be selected is
  7144.                     overlaid by another window the call will be ignored.
  7145.  
  7146.  
  7147.           See also
  7148.           See also
  7149.           ________
  7150.                     scwopen.
  7151.                     scwopen 
  7152.  
  7153.  
  7154.           Return Value
  7155.           Return Value
  7156.           ____________
  7157.                     SC_SUCCESS     window selected
  7158.                     SC_BADHNDL     invalid window handle
  7159.                     SC_WINOVRLAD   window is overlaid by another
  7160.  
  7161.  
  7162.           Example
  7163.           Example
  7164.           _______
  7165.  
  7166.           #include "SoftC.h"
  7167.           #include "windows.h"
  7168.           
  7169.           void main()
  7170.           {
  7171.             signed char win, win2;
  7172.  
  7173.  
  7174.           96    Chapter 7, The SoftC Library
  7175.           96                                
  7176.  
  7177.  
  7178.           
  7179.             scinit(20,20);
  7180.             scwopenx(&win,5,5,20,2,"Window One",0,0);
  7181.             scwputs("Hello world!");
  7182.             scwopenx(&win2,1,10,60,5,"Window Two",1,1);
  7183.             scwputs("Hello world!");
  7184.             scwselect(win);
  7185.             scwputs("I am back.");
  7186.             scwclose(win);
  7187.             scwclose(win2);
  7188.             scterm();
  7189.           }
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.           scwtget
  7196.           scwtget
  7197.           _______
  7198.  
  7199.  
  7200.  
  7201.  
  7202.           Usage
  7203.           Usage
  7204.           _____
  7205.                     signed short int scwtget( signed char *header );
  7206.                                      scwtget                        
  7207.                                                            ______   
  7208.  
  7209.  
  7210.           Prototype in
  7211.           Prototype in
  7212.           ____________
  7213.                     windows.h
  7214.  
  7215.  
  7216.           Description
  7217.           Description
  7218.           ___________
  7219.                     scwtget is  used to  get the title text string from the
  7220.                     scwtget                                                
  7221.                     current window.  scwinfo can be used to find the length
  7222.                                      scwinfo                               
  7223.                     of the  window title string. A NULL will be returned in
  7224.                     header if  there is no title or the length of the title
  7225.                     ______                                                 
  7226.                     is zero.
  7227.  
  7228.  
  7229.           See also
  7230.           See also
  7231.           ________
  7232.                     scwtput.
  7233.                     scwtput 
  7234.  
  7235.  
  7236.           Return Value
  7237.           Return Value
  7238.           ____________
  7239.                     SC_SUCCESS     record recovered
  7240.                     SC_BADHDNL     no window is open
  7241.  
  7242.  
  7243.           Example
  7244.           Example
  7245.           _______
  7246.  
  7247.           #include "SoftC.h"
  7248.           #include "windows.h"
  7249.           
  7250.           void main()
  7251.           {
  7252.  
  7253.  
  7254.                                          Chapter 7, The SoftC Library    97
  7255.                                                                          97
  7256.  
  7257.  
  7258.             char win, h[81];
  7259.           
  7260.             scinit(20,20);
  7261.             scwopenx(&win,2,2,20,5,"Title",0,0);
  7262.             scwtget(&h);
  7263.             scwputs(h);
  7264.             scwclose(win);
  7265.             scterm();
  7266.           }
  7267.  
  7268.  
  7269.  
  7270.  
  7271.  
  7272.           scwtput
  7273.           scwtput
  7274.           _______
  7275.  
  7276.  
  7277.  
  7278.  
  7279.           Usage
  7280.           Usage
  7281.           _____
  7282.                     signed short int scwtput( signed char *header);
  7283.                                      scwtput                       
  7284.                                                            ______  
  7285.  
  7286.  
  7287.           Prototype in
  7288.           Prototype in
  7289.           ____________
  7290.                     windows.h
  7291.  
  7292.  
  7293.           Description
  7294.           Description
  7295.           ___________
  7296.                     scwtput is  used to write a new title on an the current
  7297.                     scwtput                                                
  7298.                     window. Memory  will be  allocated for  the  new  title
  7299.                     message and the old title will be freed.
  7300.  
  7301.  
  7302.           See also
  7303.           See also
  7304.           ________
  7305.                     scwtget.
  7306.                     scwtget 
  7307.  
  7308.  
  7309.           Return Value
  7310.           Return Value
  7311.           ____________
  7312.                     SC_SUCCESS     record recovered
  7313.                     SC_BADHNDL     no window is open
  7314.                     SC_MEMERR      memory allocation failure
  7315.  
  7316.  
  7317.           Example
  7318.           Example
  7319.           _______
  7320.  
  7321.           #include "SoftC.h"
  7322.           #include "windows.h"
  7323.           
  7324.           void main()
  7325.           {
  7326.             char win;
  7327.           
  7328.             scinit(20,20);
  7329.             scwopenx(&win,2,2,20,5,"Title",0,0);
  7330.  
  7331.  
  7332.           98    Chapter 7, The SoftC Library
  7333.           98                                
  7334.  
  7335.  
  7336.             scwtput("Header");
  7337.             scwclose(win);
  7338.             scterm();
  7339.           }
  7340.  
  7341.  
  7342.  
  7343.  
  7344.  
  7345.           scwxloc
  7346.           scwxloc
  7347.           _______
  7348.  
  7349.  
  7350.  
  7351.  
  7352.           Usage
  7353.           Usage
  7354.           _____
  7355.                     unsigned short int scwxloc( void );
  7356.                                        scwxloc         
  7357.  
  7358.  
  7359.           Prototype in
  7360.           Prototype in
  7361.           ____________
  7362.                     windows.h
  7363.  
  7364.  
  7365.           Description
  7366.           Description
  7367.           ___________
  7368.                     scwxloc returns the x coordinate (column number) of the
  7369.                     scwxloc                                                
  7370.                     current cursor position within the selected window.
  7371.  
  7372.  
  7373.           See also
  7374.           See also
  7375.           ________
  7376.                     scwgoto, scwyloc.
  7377.                     scwgoto  scwyloc 
  7378.  
  7379.  
  7380.           Return Value
  7381.           Return Value
  7382.           ____________
  7383.                     None.
  7384.  
  7385.  
  7386.           Example
  7387.           Example
  7388.           _______
  7389.  
  7390.           #include "SoftC.h"
  7391.           #include "windows.h"
  7392.           
  7393.           void main()
  7394.           {
  7395.             unsigned short int x,y;
  7396.           
  7397.             scinit(20,20);
  7398.             scwputs("Hello world!");
  7399.             x = scwxloc();
  7400.             y = scwyloc();
  7401.             scwgoto(1,1);
  7402.             scwprintf("%d %d",x,y);
  7403.             scterm();
  7404.           }
  7405.  
  7406.  
  7407.                                          Chapter 7, The SoftC Library    99
  7408.                                                                          99
  7409.  
  7410.  
  7411.           scwyloc
  7412.           scwyloc
  7413.           _______
  7414.  
  7415.  
  7416.  
  7417.  
  7418.           Usage
  7419.           Usage
  7420.           _____
  7421.                     unsigned short int scwyloc( void );
  7422.                                        scwyloc         
  7423.  
  7424.  
  7425.           Prototype in
  7426.           Prototype in
  7427.           ____________
  7428.                     windows.h
  7429.  
  7430.  
  7431.           Description
  7432.           Description
  7433.           ___________
  7434.                     scwyloc returns  the y  coordinate (row  number) of the
  7435.                     scwyloc                                                
  7436.                     current cursor position within the selected window.
  7437.  
  7438.  
  7439.           See also
  7440.           See also
  7441.           ________
  7442.                     scwgoto, scwxloc.
  7443.                     scwgoto  scwxloc 
  7444.  
  7445.  
  7446.           Return Value
  7447.           Return Value
  7448.           ____________
  7449.                     None.
  7450.  
  7451.  
  7452.           Example
  7453.           Example
  7454.           _______
  7455.  
  7456.           #include "SoftC.h"
  7457.           #include "windows.h"
  7458.           
  7459.           void main()
  7460.           {
  7461.             unsigned short int x,y;
  7462.           
  7463.             scinit(20,20);
  7464.             scwputs("Hello world!");
  7465.             x = scwxloc();
  7466.             y = scwyloc();
  7467.             scwgoto(1,1);
  7468.             scwprintf("%d %d",x,y);
  7469.             scterm();
  7470.           }
  7471.  
  7472.  
  7473.                                        INDEX
  7474.  
  7475.  
  7476.             dtoc  16, 64, 65
  7477.                                             scikmake  16, 54, 64, 65,
  7478.             left  16, 64, 65
  7479.                                                 66
  7480.             right  16, 65
  7481.                                             sciknext  15, 67
  7482.             sccday  17, 21, 28
  7483.                                             scikprev  15, 68
  7484.             sccddiff  17, 22
  7485.                                             scinit  3, 5, 18, 69, 73,
  7486.             sccdn2s  17, 22, 23, 24
  7487.                                                 80
  7488.             sccds2n  17, 23, 24
  7489.                                             sciopen  15, 56, 70
  7490.             sccdvalid  17, 22, 23, 25
  7491.                                             scipinfo  15, 71
  7492.             sccdxlat  17, 22, 25, 26
  7493.                                             scipnum  15, 72
  7494.             sccleap  17, 26, 27, 28
  7495.                                             scterm  5, 13, 18, 70, 73
  7496.             sccleapi  17, 27
  7497.                                             scvers  18, 74
  7498.             sccmonth  17, 21, 28
  7499.                                             scwaget  8, 9, 74, 75
  7500.             scdclose  13, 15, 29
  7501.                                             scwaput  8, 9, 75
  7502.             scdcreate  13, 14, 30
  7503.                                             scwbget  10, 76, 78, 90
  7504.             scdfget  14, 32, 33, 34,
  7505.                                             scwbput  10, 77, 78
  7506.                 37, 39, 45
  7507.                                             scwcget  10, 79, 85, 90
  7508.             scdfgets  14, 32, 33, 38,
  7509.                                             scwclose  9, 81, 82, 90
  7510.                 39
  7511.                                             scwclr  8, 9, 83, 84
  7512.             scdfinfo  32, 33, 34, 35
  7513.                                             scwclreol  8, 9, 83, 84
  7514.             scdfnam2no  15, 36
  7515.                                             scwcput  10, 81, 84, 85
  7516.             scdfput  14, 32, 37, 39, 47
  7517.                                             scwcursoff  8, 85, 86
  7518.             scdfputs  14, 34, 37, 38,
  7519.                                             scwcurson  8, 86
  7520.                 39, 45, 47
  7521.                                             scwgoto  8, 85, 86, 87, 98,
  7522.             scdinfo  13, 39, 40
  7523.                                                 99
  7524.             scdopen  13, 29, 40, 41
  7525.                                             scwinfo  8, 10, 88, 96
  7526.             scdrclear  14, 41, 42
  7527.                                             scwopen  9, 77, 81, 82, 88,
  7528.             scdrcopy  14, 42, 43
  7529.                                                 89, 91, 95
  7530.             scdrdel  14, 43, 44, 48
  7531.                                             scwopenx  9, 82, 88, 90, 91
  7532.             scdrget  13, 32, 34, 44,
  7533.                                             scwprintf  7, 8, 92, 93, 94
  7534.                 45, 47
  7535.                                             scwputc  7, 8, 92, 93, 94
  7536.             scdrinfo  14, 35, 46
  7537.                                             scwputs  7, 8, 9, 18, 92,
  7538.             scdrput  13, 47
  7539.                                                 93, 94
  7540.             scdrundel  14, 44, 48
  7541.                                             scwselect  9, 82, 95
  7542.             scdsize  13, 49
  7543.                                             scwtget  10, 96, 97
  7544.             sceclr  18, 50, 52
  7545.                                             scwtput  10, 96, 97
  7546.             scemsg  18, 50, 51, 52
  7547.                                             scwxloc  8, 87, 98, 99
  7548.             sciclose  52
  7549.                                             scwyloc  8, 87, 98, 99
  7550.             scicreate  15, 53, 54, 66
  7551.                                             sc_code  18, 19, 50
  7552.             sciexpr  15, 54
  7553.                                             str  16, 65
  7554.             sciinfo  15, 55, 56, 58,
  7555.                                             substr  16, 65
  7556.                 61, 62, 63, 67, 68
  7557.             scikadd  16, 56, 57
  7558.             scikcur  16, 58
  7559.             scikdel  16, 59
  7560.             scikfind  15, 58, 60, 67,
  7561.                 68
  7562.             scikfirst  15, 58, 62, 67,
  7563.                 68
  7564.             sciklast  15, 58, 63, 67,
  7565.                 68
  7566.  
  7567.  
  7568.  
  7569.  
  7570.                                         100